/* หน้า Quiz (LIFF) ดีไซน์ v2 — design/screens/all scene.jpg */

@font-face { font-family: 'LINE Seed Sans TH'; font-weight: 400; font-display: swap; src: url('quiz/fonts/LINESeedSansTH_Rg.otf') format('opentype'); }
@font-face { font-family: 'LINE Seed Sans TH'; font-weight: 700; font-display: swap; src: url('quiz/fonts/LINESeedSansTH_Bd.otf') format('opentype'); }
@font-face { font-family: 'LINE Seed Sans TH'; font-weight: 800; font-display: swap; src: url('quiz/fonts/LINESeedSansTH_XBd.otf') format('opentype'); }
@font-face { font-family: 'LINE Seed Sans TH'; font-weight: 900; font-display: swap; src: url('quiz/fonts/LINESeedSansTH_He.otf') format('opentype'); }

:root {
  --blue: #2457ff;
  --blue-deep: #1340e6;
  --blue-dark: #0b2fc4;
  --navy: #0b1a6e;
  --green: #06c755;
  --green-dark: #03a646;
  --white: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --disabled: #b8c6ef;
  --font: 'LINE Seed Sans TH', 'Noto Sans Thai', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--white);
  background: var(--blue-deep);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #9fffc6; outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.demo-flag {
  position: fixed; bottom: calc(8px + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: 50; pointer-events: none; opacity: .9;
  margin: 0; padding: 4px 12px; border-radius: 999px;
  background: #fff3bf; color: #5a4600; font-size: 12px; white-space: nowrap;
}

/* ---------- Screens ---------- */
.screen {
  position: relative;
  min-height: 100dvh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px calc(28px + var(--safe-b));
  overflow: hidden;
}
.screen--center { display: grid; place-items: center; }

/* พื้นหลังตาราง (คำถาม / โหลด / ผลลัพธ์ / แชร์) */
.screen--grid, .modal--share {
  background:
    radial-gradient(55% 32% at 50% 46%, rgba(160, 225, 255, .75) 0%, rgba(160, 225, 255, 0) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .13) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .13) 0 1px, transparent 1px 64px),
    linear-gradient(180deg, #1145f0 0%, #2a6cf6 38%, #5aaef9 52%, #2a6cf6 70%, #1650ff 100%);
}
body:has(#screen-quiz:not([hidden])), body:has(#screen-loading:not([hidden])), body:has(#screen-result:not([hidden])) { background: #1650ff; }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 0 20px;
  border: 0; border-radius: 999px;
  font-size: 19px; font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, filter .15s, opacity .15s, background-color .15s;
}
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn--sm { min-height: 48px; font-size: 16px; }
.btn--green { background: var(--green); color: var(--white); box-shadow: 0 5px 0 var(--green-dark); }
.btn--green:active:not(:disabled) { box-shadow: 0 3px 0 var(--green-dark); }
.btn--green:disabled { background: var(--disabled); box-shadow: 0 5px 0 #9aaee0; color: rgba(255, 255, 255, .9); cursor: not-allowed; }
.btn--white { background: var(--white); color: var(--ink); box-shadow: 0 6px 16px -8px rgba(10, 30, 120, .45); }
.btn--blue { background: var(--blue); color: var(--white); box-shadow: 0 5px 0 #1236c0; }
.btn--black { background: #2b2b2b; color: var(--white); }
.btn--outline { background: var(--white); color: var(--blue); border: 2px solid var(--blue); }
.btn--icon img { width: 22px; height: 22px; }
.btn--blue.btn--icon img { filter: brightness(0) invert(1); }
/* ไอคอนสีน้ำเงิน: ใช้ SVG เป็น mask แล้วเติมสี --blue (filter ให้สีเพี้ยนเป็นม่วงบน iOS) */
.ico { display: inline-block; flex: none; width: 22px; height: 22px; background: var(--blue); -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.ico--lg { width: 28px; height: 28px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- 1 Main page ---------- */
.screen--main {
  display: flex; flex-direction: column; align-items: center;
  padding-top: 32px;
  /* ภาพพื้นเต็มความกว้างเสมอ (cover บนจอสูงจะตัดตัวการ์ตูนด้านข้าง) ส่วนที่เหลือด้านล่างเติมสีขอบล่างของภาพ */
  background: var(--bg) center top / 100% auto no-repeat, #1b54fc;
}
.screen--main { padding-top: 36px; }
/* สัดส่วนตามดีไซน์ (ความกว้างจอ 390): โลโก้ 22%, คุณเป็น 18%, หัวข้อ 80%, คำโปรย 44%, ภาพหลัก 76% */
.main-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.main-logo { width: 23%; max-width: 110px; }
.main-title { position: relative; margin: 6px 0 0; display: flex; flex-direction: column; align-items: center; width: 100%; }
/* ไฟล์หัวข้อมีขอบใสรอบตัวอักษร ใช้ระยะติดลบให้ชิดกันเท่าดีไซน์ */
.main-title > img:nth-of-type(1) { width: 28%; max-width: 136px; }
.main-title .title-shine { width: 100%; max-width: 486px; margin-top: -36px; }
.main-title > img:nth-of-type(2) { width: 53%; max-width: 258px; margin-top: -30px; position: relative; z-index: 1; }

/* ภาพหลัก + ฟองแชทลอยรอบ ๆ (ช่องชื่อซ้อนทับขอบล่างของภาพตามดีไซน์) */
.main-stage { position: relative; width: 84%; max-width: 400px; margin: 16px auto 0; }
.main-visual {
  width: 100%;
  -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
}
.screen--main .main-form { margin-top: -8px; gap: 10px; }
.screen--main .field-name, .screen--main .main-form .btn { min-height: 50px; }

.main-form { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; position: relative; z-index: 1; }
.field-name {
  width: 100%; min-height: 58px; padding: 0 24px;
  border: 0; border-radius: 999px;
  background: var(--white); color: var(--ink);
  font: inherit; font-size: 20px; font-weight: 700; text-align: center;
  box-shadow: 0 8px 20px -10px rgba(10, 30, 120, .5);
}
.field-name::placeholder { color: #9aa3b2; font-weight: 400; }
.field-name:focus { outline: 3px solid #9fffc6; }

.consent { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 15px; cursor: pointer; }
.consent input {
  appearance: none; flex: none; width: 22px; height: 22px; margin: 0;
  border: 2px solid var(--white); border-radius: 4px; background: rgba(255, 255, 255, .1);
  display: grid; place-items: center; cursor: pointer;
}
.consent input:checked { background: var(--green); border-color: var(--green); }
.consent input:checked::after { content: ''; width: 6px; height: 11px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-1px) rotate(45deg); }
.link-terms { background: none; border: 0; padding: 0; font-size: 14px; color: var(--white); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; opacity: .95; }

/* Transition ตอนเข้าหน้า: หัวข้อทีละบรรทัด → ภาพหลัก → ฟอร์ม */
.anim { opacity: 0; animation: rise .7s cubic-bezier(.2, .8, .2, 1) forwards; }
/* รอ LIFF พร้อมก่อน (LIFF redirect เปิดหน้าซ้ำ) อนิเมชันเปิดหน้าจะได้เล่นรอบเดียว */
.is-booting .anim { animation-play-state: paused; }
.main-logo.anim { animation-delay: .05s; }
.anim--1 { animation-delay: .2s; }
.anim--2 { animation-name: pop; animation-delay: .4s; }
.anim--3 { animation-delay: .7s; }
.anim--visual { animation-name: visual; animation-duration: .9s; animation-delay: 1s; }
.anim--form { animation-delay: 1.5s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.7) rotate(-3deg); } 70% { opacity: 1; transform: scale(1.04) rotate(-1deg); } 100% { opacity: 1; transform: none; } }
@keyframes visual { from { opacity: 0; transform: translateY(40px) scale(.94); } to { opacity: 1; transform: none; } }

/* ---------- ลูกเล่นหน้า Main ---------- */
/* แสงวิ่งผ่านตัวอักษร "#ผู้เชี่ยวแชท TYPE ไหน?" (ใช้รูปหัวข้อเป็น mask แสงจึงโดนเฉพาะตัวอักษร) */
.title-shine { position: relative; display: block; }
.title-shine img { width: 100%; }
.title-shine::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .85) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%; background-position: 160% 0;
  -webkit-mask: var(--mask) center / contain no-repeat; mask: var(--mask) center / contain no-repeat;
  mix-blend-mode: soft-light;
  animation: shine 4s ease-in-out 2.4s infinite;
}
@keyframes shine { 0% { background-position: 160% 0; } 45%, 100% { background-position: -60% 0; } }

/* ประกายดาวรอบหัวข้อ */
.sparkle {
  position: absolute; width: 16px; height: 16px; pointer-events: none; opacity: 0;
  background: #fff; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .9));
  /* ดาว 4 แฉก (ไม่หมุน จะได้ไม่ดูเหมือนปุ่มปิด ×) */
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  animation: twinkle 2.8s ease-in-out infinite;
}
.sparkle--1 { left: 14%; top: 4%; animation-delay: 2.2s; }
.sparkle--2 { right: 3%; top: 22%; animation-delay: 3s; width: 12px; height: 12px; }
.sparkle--3 { right: 12%; top: 92%; animation-delay: 3.8s; }
.sparkle--4 { left: 8%; top: 90%; animation-delay: 4.6s; width: 11px; height: 11px; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.3); } 45% { opacity: 1; transform: scale(1); } 75% { opacity: 0; transform: scale(.5); } }

/* ภาพหลักลอยขึ้นลงเบา ๆ */
.main-visual { animation: bob 5s ease-in-out 2s infinite; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
/* จุดในฟองเขียวพิมพ์ 1 → 2 → 3 */
.typing i { opacity: 0; }
.typing i:nth-of-type(1) { animation: dot 1.6s infinite; }
.typing i:nth-of-type(2) { animation: dot2 1.6s infinite; }
.typing i:nth-of-type(3) { animation: dot3 1.6s infinite; }

/* ปุ่มเริ่มเลยเต้นเบา ๆ เมื่อพร้อมกด */
.main-form .btn--green:not(:disabled) { animation: ready 2.2s ease-in-out infinite; }
@keyframes ready {
  0%, 100% { transform: scale(1); box-shadow: 0 5px 0 var(--green-dark), 0 0 0 0 rgba(6, 199, 85, .55); }
  50% { transform: scale(1.025); box-shadow: 0 5px 0 var(--green-dark), 0 0 0 10px rgba(6, 199, 85, 0); }
}
.field-name { transition: box-shadow .2s, transform .2s; }
.field-name:focus { transform: translateY(-2px); box-shadow: 0 12px 26px -10px rgba(10, 30, 120, .6); }

/* ---------- 3 Question ---------- */
.quiz-wrap { display: flex; flex-direction: column; gap: 18px; }
.q-count { margin: 4px 0 0; text-align: center; font-size: 24px; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.q-progress { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .35); overflow: hidden; margin-top: -4px; }
.q-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: #2ee6a0; transition: width .4s ease; }

.q-card {
  position: relative; margin: 14px 0 10px;
  min-height: 132px; padding: 26px 22px;
  display: grid; place-items: center;
  border-radius: 22px; border: 1.5px solid rgba(255, 255, 255, .7);
  background: linear-gradient(180deg, #0b39ff 0%, #0a2fd8 100%);
  box-shadow: inset 0 0 30px rgba(120, 170, 255, .45), 0 12px 30px -16px rgba(0, 20, 120, .7);
}
.q-text { margin: 0; text-align: center; font-size: 22px; line-height: 1.4; font-weight: 700; white-space: pre-line; }
.deco { position: absolute; pointer-events: none; }
/* ฟองแชทสีเขียว + จุดขาว 3 จุด */
.bubble-g { display: block; }
.bubble-g img { width: 100%; }
.bubble-g i { position: absolute; top: 34%; width: 13%; aspect-ratio: 1; border-radius: 50%; background: #fff; }
.bubble-g i:nth-of-type(1) { left: 27%; }
.bubble-g i:nth-of-type(2) { left: 44%; }
.bubble-g i:nth-of-type(3) { left: 61%; }
/* รูปจาก design/assets/graphic (เอียงมาในไฟล์แล้ว) */
.q-card .deco--green { width: 76px; right: 6px; top: -26px; }
.q-card .deco--white { width: 76px; left: 10px; bottom: -26px; }

.options { display: flex; flex-direction: column; gap: 14px; }
.opt {
  display: flex; align-items: center; gap: 16px;
  width: 100%; min-height: 66px; padding: 8px 18px 8px 10px;
  border: 0; border-radius: 999px;
  background: var(--white); color: var(--ink);
  font-size: 18px; font-weight: 700; line-height: 1.35; text-align: left;
  box-shadow: 0 8px 18px -12px rgba(10, 30, 120, .6);
  cursor: pointer;
  transition: background-color .18s, color .18s, transform .12s;
}
.opt > span:last-child { white-space: pre-line; } /* ขึ้นบรรทัดใหม่ตาม \n ในตัวเลือก */
.opt:active { transform: scale(.985); }
.opt__key {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  border: 3px solid var(--green); background: var(--white); color: var(--blue);
  font-size: 20px; font-weight: 800;
}
.opt[aria-checked="true"] { background: var(--green); color: var(--white); }
.opt[aria-checked="true"] .opt__key { border-color: var(--white); color: var(--green); }

.q-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.q-nav .btn--white { color: var(--ink); }

/* ---------- 4 Load ---------- */
.loading { position: relative; width: min(84%, 340px); aspect-ratio: 1468 / 987; }
.loading-bubble {
  position: absolute; inset: 0;
  background: var(--img) center / contain no-repeat;
  /* ตัวฟอง (ไม่รวมหางและเงา) อยู่ที่ 5.8%–86.1% ของความสูงภาพ: เว้นล่างเท่าความสูงหาง ข้อความจึงอยู่กลางฟอง */
  display: grid; place-items: center; padding: 0 6% 5.4%;
  animation: float 3s ease-in-out infinite;
}
.loading-bubble p { margin: 0; color: #2457ff; font-size: clamp(14px, 4.3vw, 18px); font-weight: 700; text-align: center; white-space: nowrap; }
.loading-dots {
  position: absolute; left: 11%; bottom: -16%; width: 52%; aspect-ratio: 967 / 580;
  background: var(--img) center / contain no-repeat;
  /* จัดจุดกลางตัวฟอง (ไม่รวมหาง): ไฟล์รูปมีขอบใส บน 13% ล่าง 24% ซ้าย/ขวา 8.5% ของภาพ
     padding % คิดจากความกว้างของ .loading (กล่องนี้กว้าง 52%) จึงคูณ 0.52 */
  display: flex; align-items: center; justify-content: center; gap: 8%; padding: 4.18% 4.47% 7.54% 4.37%;
}
.loading-dots i { width: 15%; aspect-ratio: 1; border-radius: 50%; background: #fff; opacity: .45; box-shadow: 0 0 10px rgba(255, 255, 255, .8); }
/* แสดงครบ 3 จุดเสมอ (อยู่กลางกล่อง) แล้วสว่างไล่ทีละจุด */
.loading-dots i:nth-child(1) { animation: dot-pulse 1.2s infinite; }
.loading-dots i:nth-child(2) { animation: dot-pulse 1.2s .2s infinite; }
.loading-dots i:nth-child(3) { animation: dot-pulse 1.2s .4s infinite; }
@keyframes dot  { 0%, 8% { opacity: 0; } 12%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes dot2 { 0%, 33% { opacity: 0; } 37%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes dot3 { 0%, 58% { opacity: 0; } 62%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes dot-pulse { 0%, 60%, 100% { opacity: .45; transform: scale(1); } 30% { opacity: 1; transform: scale(1.12); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- 5 Result ---------- */
.result-wrap { display: flex; flex-direction: column; gap: 16px; }
.result-card { margin: 0; border-radius: 22px; overflow: hidden; box-shadow: 0 18px 40px -18px rgba(0, 20, 120, .8); aspect-ratio: 9 / 16; background: rgba(255, 255, 255, .15); }
.result-card img { width: 100%; height: 100%; object-fit: cover; }
#screen-result.reveal .result-card { animation: reveal .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }

.fm-title { margin: 10px 0 0; text-align: center; color: #2457ff; font-size: 26px; font-weight: 800; }
/* ส่วน Feature Match อยู่บนพื้นสีอ่อน */
#screen-result .result-wrap::after { content: none; }
.fm-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; color: var(--ink); text-align: center; }
.fm-list img { width: 84px; height: 84px; margin: 0 auto 6px; }
.fm-list b { display: block; white-space: pre-line; font-size: 14px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; } /* ชื่อยาวขึ้นบรรทัดใหม่ ไม่ทับกัน */
.fm-list span { display: block; white-space: pre-line; font-size: 12.5px; color: #4b5563; line-height: 1.35; margin-top: 3px; }
#screen-result {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 52%, #e8f4ff 64%, #cfe7ff 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .13) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .13) 0 1px, transparent 1px 64px),
    linear-gradient(180deg, #1145f0 0%, #2a6cf6 30%, #5aaef9 48%, #bfe3ff 62%, #d8ecff 100%);
}

/* ---------- Modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  padding: 20px; overflow-y: auto;
  background: rgba(8, 20, 70, .55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative; width: 100%; max-width: 400px;
  border-radius: 28px; background: var(--white); color: var(--ink);
  box-shadow: 0 24px 50px -20px rgba(0, 20, 120, .6);
  animation: up .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes up { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #f1f4f9; font-size: 24px; line-height: 1; color: var(--ink); cursor: pointer; }

/* 2 T&C */
.modal-card--terms { padding: 26px 22px 22px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100dvh - 40px); }
.modal-card--terms h2 { margin: 0 40px 0 0; font-size: 18px; line-height: 1.4; }
.terms-body { overflow-y: auto; font-size: 14px; line-height: 1.65; color: #374151; padding-right: 4px; }
.terms-body h3 { margin: 12px 0 2px; font-size: 15px; color: var(--ink); }
.terms-body p { margin: 0; }
.terms-body a { color: var(--blue); }
.terms-erase { margin-top: 14px !important; padding-top: 12px; border-top: 1px solid #e5e7eb; }
.link-erase { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: #c0362c; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.modal-card--erase { padding: 26px 22px 22px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.modal-card--erase h2 { margin: 0; font-size: 20px; }
.modal-card--erase p { margin: 0 0 6px; font-size: 15px; line-height: 1.6; color: #374151; }
.btn--danger { background: #d93025; color: var(--white); box-shadow: 0 5px 0 #a3231b; }
.btn--danger:disabled { opacity: .6; cursor: progress; }
/* หน้า /privacy (ข้อความเดียวกับป๊อปอัปเงื่อนไข) */
.page-policy { background: #f3f6fb; }
.policy { max-width: 720px; margin: 0 auto; padding: 32px 16px 48px; }
.policy h1 { margin: 0; font-size: 24px; line-height: 1.4; color: var(--ink); }
.policy-sub { margin: 4px 0 20px; color: #4b5563; font-size: 15px; }
.policy .terms-body { overflow: visible; padding: 20px; border-radius: 16px; background: #fff; font-size: 15px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }

/* 6 Feature */
.modal-card--feature { overflow: hidden; padding-bottom: 24px; }
.feature-head {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; color: var(--white);
  background: linear-gradient(90deg, #2c60ff 0%, #4a6be0 55%, #1b2fb8 100%);
}
.feature-head img { width: 88px; height: 88px; border-radius: 16px; border: 2px solid rgba(255, 255, 255, .9); flex: none; object-fit: cover; }
.feature-head p { margin: 0; font-size: 14px; }
.feature-head h2 { margin: 0; color: #2fff7f; font-size: 28px; line-height: 1.2; font-weight: 900; }
.feature-brand { font-weight: 700; }
.feature-list { list-style: none; margin: 0 16px 18px; padding: 0; }
.feature-list li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 16px 0; border-bottom: 1px solid #e5e7eb; }
.feature-list img { width: 64px; height: 64px; }
.feature-list b { display: block; white-space: pre-line; font-size: 18px; font-weight: 800; line-height: 1.25; }
/* ตัดบรรทัดตาม \n ใน Config\Quiz::$features ให้แต่ละบรรทัดพอดีจอ 375px */
.feature-list span { display: block; white-space: pre-line; margin-top: 4px; font-size: min(13px, 3.4vw); line-height: 1.45; color: #2457ff; font-weight: 700; }
.modal-card--feature > .btn { width: 70%; margin: 0 auto; }

/* 7 Share */
.modal.modal--share {
  align-content: start; padding: 28px 20px calc(24px + var(--safe-b)); backdrop-filter: none;
  background:
    radial-gradient(55% 32% at 50% 40%, rgba(160, 225, 255, .75) 0%, rgba(160, 225, 255, 0) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .13) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .13) 0 1px, transparent 1px 64px),
    linear-gradient(180deg, #1145f0 0%, #2a6cf6 38%, #5aaef9 52%, #2a6cf6 70%, #1650ff 100%);
}
.share-title { margin: 0 0 16px; text-align: center; font-size: 24px; font-weight: 700; }
.share-panel {
  position: relative; width: 100%; max-width: 420px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 12px;
  padding: 22px 20px 20px;
  border-radius: 32px; border: 1.5px solid rgba(255, 255, 255, .8);
  background: linear-gradient(180deg, rgba(160, 205, 255, .45), rgba(190, 230, 255, .6));
  box-shadow: inset 0 0 40px rgba(255, 255, 255, .35);
}
.share-preview { width: 46%; margin: 0 auto 8px; border-radius: 14px; box-shadow: 0 12px 26px -12px rgba(0, 20, 120, .7); }
.share-panel .btn { min-height: 52px; font-size: 18px; }
.share-panel #trialBtn { font-size: 16px; white-space: nowrap; padding: 0 12px; }
.share-panel .btn-row .btn { min-height: 46px; font-size: 15px; }
.deco--share-l { width: 26%; left: -8%; top: 18%; }
.deco--share-r { width: 22%; right: -6%; top: 30%; }

/* 8 Save */
.modal-card--save { padding: 26px 22px 24px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.save-title { margin: 0; display: flex; align-items: center; gap: 8px; color: #2457ff; font-size: 22px; font-weight: 800; }
.save-img { width: 78%; border-radius: 16px; box-shadow: 0 12px 26px -12px rgba(0, 20, 120, .6); -webkit-touch-callout: default; user-select: auto; }
.modal-card--save .btn { width: 76%; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); z-index: 60;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: rgba(17, 24, 39, .92); color: #fff; font-size: 14px; line-height: 1.5;
  opacity: 0; pointer-events: none; transform: translate(-50%, 16px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 360px) {
  .opt { font-size: 16px; min-height: 60px; }
  .opt__key { width: 42px; height: 42px; font-size: 18px; }
  .q-text { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .loading-dots i { opacity: 1; }
  .main-visual, .sparkle, .title-shine::after, .main-form .btn--green, .typing i, .loading-bubble { animation: none !important; }
  .typing i { opacity: 1; }
}
