:root {
  --ink: #070513;
  --ink-2: #0d0920;
  --panel: rgba(14, 10, 31, .82);
  --text: #f5f2ff;
  --muted: #a8a0c2;
  --violet: #8d5cff;
  --violet-bright: #bda8ff;
  --cyan: #40e8ff;
  --lime: #c9ff63;
  --line: rgba(189, 168, 255, .18);
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ink); }
body {
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 72% 20%, rgba(71, 41, 145, .32), transparent 34%),
    radial-gradient(circle at 10% 88%, rgba(23, 168, 185, .14), transparent 30%),
    linear-gradient(145deg, #05030d 0%, #0b0719 50%, #070513 100%);
  font-family: "Noto Sans Thai", system-ui, sans-serif;
  overflow-x: hidden;
}
button, a { font: inherit; }
button { color: inherit; }

.ambient { position: fixed; z-index: 0; pointer-events: none; border-radius: 50%; filter: blur(80px); opacity: .28; }
.ambient-a { width: 380px; height: 380px; right: -170px; top: 5%; background: var(--violet); animation: floatA 11s ease-in-out infinite alternate; }
.ambient-b { width: 300px; height: 300px; left: -160px; bottom: 3%; background: #00c6dc; animation: floatB 13s ease-in-out infinite alternate; }
.grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .38;
  background-image:
    linear-gradient(rgba(141, 92, 255, .065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141, 92, 255, .065) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 80%, transparent);
}
.grid::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(64, 232, 255, .08) 50%, transparent 60%); animation: scan 8s linear infinite; }

.topbar, .shell, .site-foot { position: relative; z-index: 1; width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.topbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-symbol { position: relative; width: 43px; height: 43px; transform: rotate(45deg); }
.brand-symbol::before, .brand-symbol::after, .brand-symbol i { content: ""; position: absolute; border: 2px solid var(--violet-bright); }
.brand-symbol::before { inset: 2px 17px 17px 2px; border-right: 0; border-bottom: 0; }
.brand-symbol::after { inset: 17px 2px 2px 17px; border-left: 0; border-top: 0; }
.brand-symbol i:first-child { width: 16px; height: 16px; left: 13px; top: 13px; border-color: var(--cyan); box-shadow: 0 0 20px rgba(64, 232, 255, .6); }
.brand-symbol i:last-child { inset: 0; border-color: rgba(189, 168, 255, .14); }
.brand-copy { display: grid; line-height: 1; }
.brand-copy b { font-family: "Chakra Petch", sans-serif; font-size: 22px; letter-spacing: .22em; }
.brand-copy small { margin-top: 7px; color: var(--muted); font-family: "Chakra Petch", sans-serif; font-size: 9px; letter-spacing: .18em; }
.system-status { display: inline-flex; align-items: center; gap: 9px; color: #c7bfdf; font-family: "Chakra Petch", sans-serif; font-size: 11px; letter-spacing: .14em; }
.system-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 15px var(--lime); animation: blink 2s ease-in-out infinite; }

.shell { min-height: calc(100svh - 146px); display: grid; grid-template-columns: minmax(0, .9fr) minmax(440px, 1.1fr); align-items: center; gap: clamp(42px, 7vw, 100px); padding: 58px 0; }
.intro { min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 13px; color: var(--cyan); font-family: "Chakra Petch", sans-serif; font-size: 11px; letter-spacing: .18em; }
.eyebrow::before { content: ""; width: 36px; height: 1px; background: var(--cyan); box-shadow: 0 0 10px rgba(64, 232, 255, .6); }
.eyebrow b { margin-left: auto; color: #766e91; font-weight: 600; }
h1 { margin: 24px 0 20px; font-size: clamp(48px, 6.2vw, 84px); line-height: .97; letter-spacing: -.055em; font-weight: 800; }
h1 em { display: inline-block; color: transparent; background: linear-gradient(110deg, var(--violet-bright), #ffffff 47%, var(--cyan)); background-clip: text; -webkit-background-clip: text; font-style: normal; }
.lead { max-width: 535px; margin: 0; color: #b9b2cc; font-size: 16px; line-height: 1.85; }
.signal-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 38px; border: 1px solid var(--line); background: var(--line); }
.signal-list > div { min-height: 94px; display: flex; gap: 12px; align-items: center; padding: 15px; background: rgba(8, 5, 19, .78); }
.signal-list > div > span { color: var(--violet-bright); font-family: "Chakra Petch", sans-serif; font-size: 12px; }
.signal-list p { display: grid; gap: 5px; margin: 0; }
.signal-list b { font-size: 13px; }
.signal-list small { color: #827b98; font-size: 10px; line-height: 1.4; }
.intro-foot { display: flex; justify-content: space-between; margin-top: 18px; color: #514a69; font-family: "Chakra Petch", sans-serif; font-size: 9px; letter-spacing: .18em; }

.quiz-card { position: relative; min-height: 650px; overflow: hidden; border: 1px solid rgba(189, 168, 255, .24); border-radius: 28px; background: linear-gradient(160deg, rgba(19, 13, 41, .92), rgba(8, 5, 20, .88)); box-shadow: 0 35px 100px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255,255,255,.07); backdrop-filter: blur(24px); }
.quiz-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(189,168,255,.55), transparent 35%, transparent 70%, rgba(64,232,255,.26)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.card-glow { position: absolute; width: 260px; height: 260px; right: -130px; top: -120px; border-radius: 50%; background: rgba(141, 92, 255, .38); filter: blur(40px); pointer-events: none; }
.quiz-head { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 28px 30px 20px; }
.micro-label { color: var(--violet-bright); font-family: "Chakra Petch", sans-serif; font-size: 10px; letter-spacing: .15em; }
.quiz-head h2 { margin: 7px 0 0; font-size: 19px; line-height: 1.35; }
.step-count { display: flex; align-items: baseline; gap: 4px; color: #706787; font-family: "Chakra Petch", sans-serif; }
.step-count b { color: var(--cyan); font-size: 24px; }
.step-count span { font-size: 12px; }
.progress-track { position: relative; height: 2px; margin: 0 30px; overflow: hidden; background: rgba(189,168,255,.12); }
.progress-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--violet), var(--cyan)); box-shadow: 0 0 12px var(--cyan); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.quiz-viewport { position: relative; min-height: 535px; }
.screen { display: none; min-height: 535px; padding: 34px 30px 30px; animation: screenIn .42s cubic-bezier(.2,.8,.2,1); }
.screen.is-active { display: flex; flex-direction: column; }
.screen[data-screen="intro"] { align-items: flex-start; justify-content: center; }
.orb { position: relative; width: 96px; height: 96px; margin-bottom: 30px; border: 1px solid rgba(189,168,255,.26); border-radius: 50%; background: radial-gradient(circle, rgba(141,92,255,.26), rgba(9,5,20,.5) 64%); box-shadow: 0 0 50px rgba(141,92,255,.16); }
.orb::before, .orb::after, .orb span, .orb i { content: ""; position: absolute; border-radius: 50%; }
.orb::before { inset: 12px; border: 1px dashed rgba(64,232,255,.46); animation: spin 10s linear infinite; }
.orb::after { inset: 29px; background: linear-gradient(145deg, var(--violet), var(--cyan)); box-shadow: 0 0 26px rgba(64,232,255,.42); }
.orb span { width: 8px; height: 8px; left: 8px; top: 44px; background: var(--lime); box-shadow: 0 0 13px var(--lime); }
.orb i { inset: -8px; border: 1px solid rgba(189,168,255,.08); }
.screen-kicker, .question-index { margin: 0 0 12px; color: var(--cyan); font-family: "Chakra Petch", sans-serif; font-size: 10px; letter-spacing: .2em; }
.screen h3 { margin: 0; font-size: clamp(28px, 3vw, 40px); line-height: 1.2; letter-spacing: -.03em; }
.screen-copy { margin: 16px 0 0; color: #a8a0bb; font-size: 14px; line-height: 1.75; }
.primary-button, .line-button { width: 100%; min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 28px; padding: 14px 18px 14px 22px; border: 0; border-radius: 15px; color: #0b0717; background: linear-gradient(105deg, #c5b3ff, #8d5cff 48%, #40e8ff); box-shadow: 0 16px 42px rgba(116,73,233,.3); font-weight: 800; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; text-decoration: none; }
.primary-button:hover, .line-button:hover { transform: translateY(-2px); box-shadow: 0 20px 52px rgba(116,73,233,.42); }
.primary-button:focus-visible, .line-button:focus-visible, .answer:focus-visible, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.primary-button i, .line-button > i { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(8,5,20,.9); color: var(--cyan); font-size: 18px; font-style: normal; }
.privacy-note { width: 100%; margin-top: 13px; color: #625b78; font-size: 10px; text-align: center; }
.question-hint { margin: 10px 0 20px; color: #817991; font-size: 12px; }
.answer-list { display: grid; gap: 10px; }
.answer { width: 100%; min-height: 76px; display: grid; grid-template-columns: 42px 1fr 24px; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid rgba(189,168,255,.14); border-radius: 14px; color: #eeeaff; background: rgba(255,255,255,.025); text-align: left; cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.answer:hover { transform: translateX(3px); border-color: rgba(64,232,255,.44); background: rgba(64,232,255,.055); }
.answer .answer-code { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(189,168,255,.2); border-radius: 10px; color: var(--violet-bright); font-family: "Chakra Petch", sans-serif; font-size: 11px; }
.answer .answer-copy { display: grid; gap: 3px; }
.answer b { font-size: 14px; }
.answer small { color: #7f778f; font-size: 10px; line-height: 1.45; }
.answer > i { color: var(--cyan); font-style: normal; font-size: 16px; }
.back-button, .restart-button { align-self: flex-start; margin-top: auto; padding: 12px 0 0; border: 0; color: #6f6782; background: transparent; font-size: 11px; cursor: pointer; }
.result-screen { align-items: stretch; justify-content: center; }
.result-mark { width: 78px; height: 78px; display: grid; place-items: center; margin-bottom: 22px; border: 1px solid rgba(64,232,255,.35); border-radius: 24px; background: linear-gradient(145deg, rgba(141,92,255,.24), rgba(64,232,255,.12)); transform: rotate(6deg); box-shadow: 0 0 36px rgba(64,232,255,.11); }
.result-mark span { font: 700 34px "Chakra Petch", sans-serif; color: var(--cyan); transform: rotate(-6deg); }
.result-summary { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #7e7592; font: 11px "Chakra Petch", sans-serif; letter-spacing: .14em; }
.result-summary b { color: var(--lime); font-size: 20px; letter-spacing: 0; }
.line-button { background: linear-gradient(105deg, #aefc72, #63ed9f 48%, #42e7ff); }
.line-button .line-icon, .primary-button .line-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 44px; border-radius: 13px; background: #06c755; color: #fff; font: 700 10px "Chakra Petch", sans-serif; }
.line-button .line-icon svg, .primary-button .line-icon svg { width: 32px; height: 32px; fill: #fff; }
.line-button .line-icon .line-word, .primary-button .line-icon .line-word { fill: #06c755; }
.primary-button .button-copy { display: grid; flex: 1; gap: 2px; text-align: left; }
.primary-button .button-copy b { font-size: 15px; }
.primary-button .button-copy small { font-size: 9px; font-weight: 600; opacity: .62; }
.line-button > span:nth-child(2) { display: grid; gap: 2px; flex: 1; }
.line-button b { font-size: 14px; }
.line-button small { font-size: 9px; font-weight: 600; opacity: .62; }
.restart-button { align-self: center; margin-top: 14px; text-decoration: underline; text-underline-offset: 4px; }
.card-foot { position: absolute; left: 30px; right: 30px; bottom: 18px; display: flex; align-items: center; justify-content: space-between; color: #4e475f; font: 9px "Chakra Petch", sans-serif; letter-spacing: .13em; }
.card-foot b { color: #77708a; }
.site-foot { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: var(--safe-bottom); color: #4f4860; font-size: 9px; letter-spacing: .08em; }
.noscript { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 20; padding: 14px; border-radius: 12px; background: #fff; color: #111; text-align: center; }
.noscript a { color: #5030a4; }

@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .38; } }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes floatA { to { transform: translate(-45px, 70px) scale(1.12); } }
@keyframes floatB { to { transform: translate(55px, -55px) scale(.9); } }

@media (max-width: 900px) {
  .topbar { min-height: 76px; }
  .shell { grid-template-columns: 1fr; gap: 34px; padding: 44px 0 52px; }
  .intro { max-width: 680px; }
  .quiz-card { width: min(100%, 600px); min-height: 630px; margin-inline: auto; }
  .site-foot { padding-top: 4px; }
}
@media (max-width: 560px) {
  .topbar, .shell, .site-foot { width: min(100% - 28px, 1180px); }
  .topbar { min-height: 70px; }
  .brand-symbol { width: 36px; height: 36px; }
  .brand-symbol i:first-child { width: 14px; height: 14px; left: 11px; top: 11px; }
  .brand-copy b { font-size: 18px; }
  .brand-copy small { font-size: 8px; }
  .system-status { font-size: 8px; letter-spacing: .1em; }
  .shell { min-height: auto; padding: 34px 0 36px; }
  .eyebrow b { display: none; }
  h1 { margin-top: 19px; font-size: clamp(43px, 13vw, 62px); }
  .lead { font-size: 14px; line-height: 1.72; }
  .signal-list { margin-top: 28px; }
  .signal-list > div { min-height: 77px; display: grid; gap: 5px; padding: 11px 8px; }
  .signal-list p { gap: 2px; }
  .signal-list small { display: none; }
  .quiz-card { min-height: 610px; border-radius: 22px; }
  .quiz-head { padding: 22px 20px 17px; }
  .quiz-head h2 { font-size: 16px; }
  .progress-track { margin-inline: 20px; }
  .quiz-viewport, .screen { min-height: 510px; }
  .screen { padding: 28px 20px 52px; }
  .orb { width: 80px; height: 80px; margin-bottom: 24px; }
  .orb::after { inset: 25px; }
  .screen h3 { font-size: 28px; }
  .answer { min-height: 74px; padding: 11px; }
  .answer b { font-size: 13px; }
  .card-foot { left: 20px; right: 20px; bottom: 16px; }
  .site-foot { display: grid; justify-content: start; gap: 5px; padding-bottom: calc(var(--safe-bottom) + 6px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
