/* เกมตัทธิต ธีมห้องฉาย (/taddhita/<ด่าน>/study|play) — พี่น้องกับเกมอักขรวิธี: พื้นครามเข้ม ทองเป็นสีเน้นเดียว
   สีมีความหมาย ๒ ชุดเท่านั้น
   ① ประเภทใหญ่ของตัทธิต  --g-saman (สามัญญ) · --g-bhava (ภาว) · --g-abyaya (อัพยย) — ป้ายชนิด การ์ดชนิด
   ② บทบาทของคำในรูปวิเคราะห์  --r-base ศัพท์เดิม · --r-sig คำที่ปัจจัยมาแทน · ทอง = ปัจจัย (ตรา) · ขาว/ดำ = ศัพท์สำเร็จ
   ห้ามใช้สีชุดนี้ตกแต่งเฉย ๆ */
@font-face { font-family: "Sriracha Local"; src: url("/assets/fonts/sriracha/Sriracha-Regular.ttf?v=20260806.1") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Thunder Pali"; font-weight: 400 500; font-display: swap; src: url("/assets/fonts/thunder-pali/ThunderPali-400.woff2") format("woff2"); unicode-range: U+0E00-0E7F, U+25CC; }
@font-face { font-family: "Thunder Pali"; font-weight: 600 700; font-display: swap; src: url("/assets/fonts/thunder-pali/ThunderPali-700.woff2") format("woff2"); unicode-range: U+0E00-0E7F, U+25CC; }
@font-face { font-family: "Thunder Pali"; font-weight: 800 900; font-display: swap; src: url("/assets/fonts/thunder-pali/ThunderPali-800.woff2") format("woff2"); unicode-range: U+0E00-0E7F, U+25CC; }
:root {
	color-scheme: dark;
	--bg: #0a0f1e; --bg2: #10183a; --bg3: #0c1330; --panel: #141d3d;
	--ink: #f3f6ff; --ink2: #d7deef; --muted: #aab4d0; --dim: #7f8aa8; --strong: #ffffff;
	--gold: #f5bf45; --on-gold: #3b2600; --quote: #fde9b0; --shadow: rgba(0,0,0,.5);
	--line: color-mix(in srgb, var(--strong) 10%, transparent);
	--g-saman: #5eead4; --g-bhava: #c4b5fd; --g-abyaya: #f0abfc;
	--r-base: #7dd3fc; --r-sig: #fb923c;
	--ok: #4ade80; --bad: #fb7185;
	--f-body: "Sarabun", "Thonburi", "Leelawadee UI", sans-serif;
	--f-hand: "Sriracha Local", "Sarabun", sans-serif;
	--f-pali: "Thunder Pali", "Sarabun", sans-serif;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
	color-scheme: light;
	--bg: #f5f7fc; --bg2: #ffffff; --bg3: #eef2fb; --panel: #ffffff;
	--ink: #141a33; --ink2: #333c5c; --muted: #525b78; --dim: #69728f; --strong: #141a33;
	--gold: #b45309; --on-gold: #ffffff; --quote: #8a4b06; --shadow: transparent;
	--g-saman: #0f766e; --g-bhava: #6d28d9; --g-abyaya: #a21caf;
	--r-base: #0369a1; --r-sig: #c2410c;
	--ok: #15803d; --bad: #be123c;
} }
:root[data-theme="light"] {
	color-scheme: light;
	--bg: #f5f7fc; --bg2: #ffffff; --bg3: #eef2fb; --panel: #ffffff;
	--ink: #141a33; --ink2: #333c5c; --muted: #525b78; --dim: #69728f; --strong: #141a33;
	--gold: #b45309; --on-gold: #ffffff; --quote: #8a4b06; --shadow: transparent;
	--g-saman: #0f766e; --g-bhava: #6d28d9; --g-abyaya: #a21caf;
	--r-base: #0369a1; --r-sig: #c2410c;
	--ok: #15803d; --bad: #be123c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.td-page { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.6; overflow-x: hidden; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.pali, .pali-nt { font-family: var(--f-pali); }
.pali { font-weight: 800; white-space: nowrap; }
a.btn, a.stop, a.four-card { text-decoration: none; }

/* ── แถบบน ── */
.td-bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.td-bar-in { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 60px; }
.td-back, .td-pill-link { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; color: var(--ink); font-weight: 800; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.td-back:hover, .td-pill-link:hover { color: var(--gold); }
.td-bar-title { font-weight: 800; font-size: .95rem; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-bar-title i { color: var(--gold); margin-right: .25rem; }
.td-bar-actions { display: flex; align-items: center; gap: .5rem; }
.td-pill-link { padding: 0 .9rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--strong) 22%, transparent); }
.theme-btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1rem; border-radius: 999px; cursor: pointer;
	border: 1px solid color-mix(in srgb, var(--strong) 22%, transparent); background: color-mix(in srgb, var(--bg) 72%, transparent); color: var(--ink); font-weight: 800; font-size: .88rem; }
.theme-btn svg { width: 18px; height: 18px; flex: none; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; } :root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; } :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; } }
.td-error { margin-block: 2rem 0; padding-block: 1rem; color: var(--ink); font-weight: 700; }
.td-error a, .note a { color: var(--gold); font-weight: 800; }

/* ── ฉากเปิด (ต้นตัทธิต: เมล็ดเดียวแตกเป็น ๑๕ ผล) ── */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero-art { position: absolute; inset: 0; z-index: -2; background: url("/assets/game/hub/taddhita.jpg") right 84% / cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 36%, color-mix(in srgb, var(--bg) 30%, transparent) 70%, color-mix(in srgb, var(--bg) 8%, transparent) 100%),
		linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 0%, transparent) 42%); }
.hero-inner { display: flex; flex-direction: column; gap: .7rem; padding-block: 2.5rem 2.2rem; max-width: 620px; }
.eyebrow { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.pill-gold { background: var(--gold); color: var(--on-gold); }
.pill-ghost { background: color-mix(in srgb, var(--strong) 10%, transparent); border: 1px solid color-mix(in srgb, var(--strong) 20%, transparent); color: var(--ink2); }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); font-weight: 800; line-height: 1.22; letter-spacing: -.01em; text-shadow: 0 2px 24px var(--shadow); }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero-quote { font-family: var(--f-hand); font-size: 1.1rem; color: var(--quote); margin: 0; }
.hero-lead { color: var(--ink2); margin: 0; max-width: 36em; }
.hero-lead b { color: var(--strong); }
.hero-compact .hero-inner { padding-block: 1.6rem 1rem; gap: .45rem; }
.hero-compact h1 { font-size: clamp(1.9rem, 4.6vw, 2.8rem); }
.hero-compact .hero-lead { font-size: .95rem; }

/* ── เส้นทาง ๙ ด่าน ── */
.path { display: flex; align-items: flex-start; overflow-x: auto; scrollbar-width: none; padding-block: .4rem 1rem; margin-top: .6rem; }
.path::-webkit-scrollbar { display: none; }
.stop { position: relative; flex: 1 0 100px; display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; color: inherit; }
.stop::before { content: ""; position: absolute; top: 19px; left: calc(-50% + 22px); right: calc(50% + 22px); height: 2px; background: var(--line); }
.stop:first-child::before { display: none; }
.stop.done::before, .stop.now::before { background: var(--gold); }
.stop-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--panel); border: 2px solid var(--line); color: var(--muted); }
.stop.done .stop-dot { border-color: color-mix(in srgb, var(--gold) 60%, transparent); color: var(--ink); }
.stop.now .stop-dot { background: var(--gold); border-color: var(--gold); color: var(--on-gold); box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 18%, transparent); }
.stop-name { font-size: .8rem; font-weight: 700; color: var(--muted); line-height: 1.35; }
.stop.now .stop-name { color: var(--strong); }
.stop-zone { font-size: .68rem; color: var(--dim); }
.stop-stars { display: inline-flex; gap: 1px; font-size: .78rem; line-height: 1; color: color-mix(in srgb, var(--strong) 22%, transparent); }
.stop-stars .on { color: var(--gold); }
a.stop:hover .stop-dot { border-color: var(--gold); color: var(--ink); }
a.stop:hover .stop-name { color: var(--ink); }
.hero-compact .path { margin-top: .2rem; padding-bottom: .6rem; }
.hero-compact .stop-dot { width: 34px; height: 34px; font-size: .9rem; }
.hero-compact .stop::before { top: 16px; }

/* ── ช่วงเนื้อหา ── */
.sec { padding-block: 2.2rem; }
.sec + .sec { border-top: 1px solid var(--line); }
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .5rem 1.5rem; margin-bottom: 1.2rem; }
.sec-kick { font-size: .78rem; font-weight: 800; letter-spacing: .06em; color: var(--gold); }
.sec h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); font-weight: 800; line-height: 1.3; }
.sec h2 em { font-style: normal; color: var(--gold); }
.sec-sub { color: var(--muted); margin: .25rem 0 0; font-size: .95rem; max-width: 42em; }
.lead-box { margin: 0 0 1rem; max-width: 46em; color: var(--ink2); }
.callout { margin: 1rem 0 0; padding: .8rem 1rem; border-radius: 14px; background: color-mix(in srgb, var(--gold) 8%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); color: var(--ink2); font-size: .95rem; }
.callout b { color: var(--quote); }
.callout-l { display: flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 800; color: var(--gold); margin-bottom: .2rem; }

/* ── ปุ่ม ── */
.btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 52px; padding: 0 1.4rem; border-radius: 14px; border: 0; font-weight: 800; font-size: 1rem; cursor: pointer; white-space: nowrap; }
.btn-main { background: var(--strong); color: var(--bg); }
.btn-main:hover { background: var(--gold); color: var(--on-gold); }
.btn-ghost { flex: 0 1 auto; background: color-mix(in srgb, var(--strong) 12%, transparent); color: var(--strong); }
.btn-ghost:hover { background: color-mix(in srgb, var(--strong) 20%, transparent); }
.switch, .seg button, .chipbtn { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line);
	background: color-mix(in srgb, var(--strong) 5%, transparent); cursor: pointer; font-weight: 800; font-size: .9rem; color: var(--ink2); white-space: nowrap; }
.switch[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.recite-bar, .tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.seg { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.seg button[aria-pressed="true"], .chipbtn[aria-pressed="true"] { background: var(--strong); color: var(--bg); border-color: var(--strong); }
.dock { position: sticky; bottom: 0; z-index: 5; padding-bottom: env(safe-area-inset-bottom, 0px); background: linear-gradient(0deg, var(--bg) 60%, color-mix(in srgb, var(--bg) 0%, transparent)); }
.dock .wrap { display: flex; gap: .6rem; padding-block: 1rem; }
.note { color: var(--dim); font-size: .8rem; text-align: center; padding: 1rem 20px 6rem; margin: 0; }

/* ══════════ ชิ้นส่วนกลาง (taddhita-kit.js) ══════════ */
/* ป้ายชนิด */
.tchip { --gc: var(--g-saman); display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .65rem .1rem .3rem; border-radius: 999px; white-space: nowrap; flex: none;
	background: color-mix(in srgb, var(--gc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--gc) 45%, transparent); color: color-mix(in srgb, var(--gc) 75%, var(--ink)); font-weight: 800; font-size: .82rem; }
.tchip-n { display: grid; place-items: center; min-width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--gc); color: var(--bg); font-size: .72rem; }
.tchip:not(:has(.tchip-n)) { padding-left: .65rem; }
/* ตราปัจจัย */
.seal { display: inline-grid; place-items: center; min-width: 2.6rem; height: 2.1rem; padding: 0 .65rem; border-radius: 10px; flex: none;
	background: var(--gold); color: var(--on-gold); font-size: 1.05rem; line-height: 1; box-shadow: 0 6px 16px -10px var(--gold), inset 0 1px 0 color-mix(in srgb, #fff 35%, transparent); }
.seal-mini { min-width: 0; height: 1.5rem; font-size: .78rem; padding: 0 .45rem; border-radius: 7px; font-family: var(--f-body); }
.seal-ghost { background: none; color: var(--gold); border: 1.5px dashed color-mix(in srgb, var(--gold) 60%, transparent); box-shadow: none; }
/* ป้ายบทบาท */
.roles { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; font-size: .84rem; font-weight: 700; color: var(--muted); }
.role { display: inline-flex; align-items: center; gap: .4rem; }
.role i { width: 1.4rem; height: .3rem; border-radius: 4px; }
.role-base i { background: var(--r-base); } .role-sig i { background: var(--r-sig); } .role-fin i { background: var(--strong); }
/* รูปวิเคราะห์แยกสี */
.story { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .55rem; font-size: 1.35rem; line-height: 1.7; }
.tk { white-space: nowrap; padding-bottom: 1px; border-bottom: 3px solid transparent; }
.tk-base { color: var(--r-base); border-color: color-mix(in srgb, var(--r-base) 55%, transparent); }
.tk-sig { color: var(--r-sig); border-color: var(--r-sig); border-bottom-style: solid; }
.tk-extra { color: var(--ink2); }
.tk-fin { color: var(--strong); }
.tk-fin::before { content: "→"; font-family: var(--f-body); color: var(--dim); font-weight: 700; margin-right: .5rem; }
.tk-blank { color: var(--gold); border: 2px dashed var(--gold); border-radius: 8px; padding: 0 .55rem; }
.story-none { font-size: .95rem; }
.story-empty { font-family: var(--f-body); font-weight: 700; color: var(--dim); white-space: normal; }
/* การ์ดคลี่คำ */
.uf { --gc: var(--g-saman); display: flex; flex-direction: column; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; transition: border-color .25s, box-shadow .25s; }
.uf.is-open { border-color: color-mix(in srgb, var(--gc) 50%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gc) 30%, transparent) inset; }
.uf-head { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 64px; padding: .7rem 1rem; border: 0; background: none; cursor: pointer; text-align: left; }
.uf-w { font-size: 1.7rem; color: var(--strong); line-height: 1.3; }
.uf-cue { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 800; color: var(--dim); white-space: nowrap; }
.uf-head:hover .uf-cue { color: var(--gold); }
.uf-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.uf.is-open .uf-body { grid-template-rows: 1fr; }
.uf-in { overflow: hidden; display: flex; flex-direction: column; gap: .5rem; padding: 0 1rem; }
.uf.is-open .uf-in { padding-bottom: 1rem; }
.uf-in .story { padding: .6rem .8rem; border-radius: 12px; background: color-mix(in srgb, var(--strong) 4%, transparent); }
.uf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.uf-mean { font-weight: 800; color: var(--ink); }
.uf-trans, .uf-alt, .uf-note { margin: 0; font-size: .88rem; color: var(--muted); line-height: 1.6; }
.uf-note { color: var(--quote); }
.uf-compact .uf-w { font-size: 1.4rem; }
.uf-compact .story { font-size: 1.15rem; }
.uf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .7rem; align-items: start; }
/* ปีที่ออกสอบ */
.qa-exams { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 800; color: var(--gold); }
.qa-year { padding: 0 .45rem; border-radius: 6px; font-weight: 700; color: var(--ink2); background: color-mix(in srgb, var(--gold) 12%, transparent); font-variant-numeric: tabular-nums; }
.kw { font-weight: 800; white-space: nowrap; }
.kw-saman { color: var(--g-saman); } .kw-bhava { color: var(--g-bhava); } .kw-abyaya { color: var(--g-abyaya); }

/* ── คำตอบสนามหลวง ── */
.qa-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.qa-list-1 { grid-template-columns: 1fr; }
.qa { display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.qa-top { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.qa-topic { padding: .05rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 800; background: color-mix(in srgb, var(--strong) 10%, transparent); color: var(--ink2); }
.qa-q { margin: 0; font-weight: 800; color: var(--strong); font-size: 1rem; line-height: 1.5; }
.qa-a { text-align: left; padding: .65rem .8rem; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--gold) 26%, transparent); background: color-mix(in srgb, var(--gold) 6%, transparent);
	color: var(--ink2); font-size: .98rem; font-weight: 600; line-height: 1.75; cursor: default; transition: filter .25s; font-family: var(--f-body); }
.hide .qa-a { filter: blur(7px); cursor: pointer; user-select: none; }
.hide .qa-a.shown { filter: none; }

/* ══════════ ด่าน ๑ ท่องปัจจัย ══════════ */
/* ย่อเรื่อง ๓ ขั้น */
.squeeze-tabs { margin-bottom: 1rem; }
.squeeze { display: grid; grid-template-columns: minmax(0, 1.25fr) auto minmax(0, 1fr) auto minmax(0, .9fr); align-items: stretch; gap: .6rem; }
.sq { position: relative; display: flex; flex-direction: column; gap: .45rem; padding: 1rem 1.1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.sq-n { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 800; color: var(--gold); }
.sq-n b { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--gold); color: var(--on-gold); font-size: .8rem; }
.sq .story { font-size: 1.3rem; }
.sq-mid { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: 1.05rem; font-weight: 800; }
.sq-mid .tk-sig { font-family: var(--f-pali); }
.sq-mid s { text-decoration-color: var(--r-sig); text-decoration-thickness: 2px; }
.sq-fin { font-size: 2.1rem; color: var(--strong); line-height: 1.3; }
.sq-mean { font-weight: 800; color: var(--ink2); font-size: .95rem; }
.sq-arrow { align-self: center; color: var(--gold); font-size: 1.3rem; }
.sq.fin { border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 70%), var(--panel); }
.def-card { margin-top: 1rem; }
/* ต้น ๓ → ๑๓ */
.tree { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 1rem 1.4rem; align-items: center; }
.tnode { display: flex; flex-direction: column; gap: .05rem; padding: .8rem 1rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-align: left; }
.tnode-n { font-size: 2.2rem; font-weight: 800; line-height: 1.1; color: var(--gc, var(--gold)); font-variant-numeric: tabular-nums; }
.tnode-l { font-size: .9rem; font-weight: 800; color: var(--ink2); }
.tnode-s { font-size: .78rem; color: var(--dim); font-weight: 700; }
.troot .tnode-n { font-size: clamp(3rem, 8vw, 4.4rem); }
.tbranches { display: grid; gap: .6rem; }
.tbranch { --gc: var(--g-saman); display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: .8rem; align-items: center; }
.tbranch .tnode { border-left: 4px solid var(--gc); }
.tbranch-kids { display: flex; flex-wrap: wrap; gap: .35rem; }
.teq { color: var(--dim); font-weight: 800; font-size: 1.4rem; }
/* ราวโคม ๑๓ ดวง (สูตรจำ) */
.lanterns { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: .4rem; margin-top: 1.4rem; }
.lantern { --gc: var(--g-saman); position: relative; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .55rem .2rem .5rem; border-radius: 14px 14px 18px 18px; cursor: pointer;
	border: 1px solid color-mix(in srgb, var(--gc) 35%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--gc) 16%, transparent), transparent); min-height: 92px; }
.lantern.grp-1 { --gc: color-mix(in srgb, var(--g-saman) 70%, var(--g-bhava)); }
.lantern.grp-2 { --gc: color-mix(in srgb, var(--g-saman) 45%, var(--r-base)); }
.lantern-syl { font-size: 1.45rem; font-weight: 800; color: var(--strong); line-height: 1.2; }
.lantern-n { font-size: .7rem; font-weight: 800; color: var(--dim); }
.lantern-t { font-size: .68rem; font-weight: 700; color: var(--muted); line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.lantern[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 0 22px -8px var(--gold); }
.lantern-gap { grid-column: span 1; }
.memo-line { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem .8rem; margin-top: .8rem; font-family: var(--f-hand); font-size: 1.25rem; color: var(--quote); }
/* กระดานปัจจัย */
.pboard { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.3rem; align-items: start; }
.prows { display: flex; flex-direction: column; gap: .4rem; }
.pgroup-h { display: flex; align-items: center; gap: .55rem; margin: .7rem 0 .1rem; font-size: .82rem; font-weight: 800; color: var(--gc); letter-spacing: .03em; }
.pgroup-h:first-child { margin-top: 0; }
.pgroup-h::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--gc) 35%, transparent); }
.prow { --gc: var(--g-saman); display: grid; grid-template-columns: 2rem 9.5rem minmax(0, 1fr) 2.6rem; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: 12px; cursor: pointer;
	border: 1px solid var(--line); background: color-mix(in srgb, var(--strong) 3%, transparent); text-align: left; width: 100%; transition: opacity .25s, border-color .2s, background-color .2s; }
.prow:hover { border-color: color-mix(in srgb, var(--gc) 50%, transparent); }
.prow[aria-pressed="true"] { border-color: var(--gc); background: color-mix(in srgb, var(--gc) 10%, transparent); }
.prow-n { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: color-mix(in srgb, var(--gc) 20%, transparent); color: var(--gc); font-weight: 800; font-size: .85rem; }
.prow-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.prow-t b { font-weight: 800; color: var(--strong); font-size: .98rem; }
.prow-t span { font-size: .76rem; color: var(--dim); font-weight: 700; }
.prow-p { display: flex; flex-wrap: wrap; gap: .3rem; }
.prow-p .seal { min-width: 2.3rem; height: 1.85rem; font-size: .95rem; padding: 0 .5rem; }
.prow-c { font-size: 1.15rem; font-weight: 800; color: var(--gold); text-align: right; font-variant-numeric: tabular-nums; }
.prows.spot .prow:not(.lit) { opacity: .25; }
.prows.spot .seal.hit { box-shadow: 0 0 0 3px var(--strong); }
.pac-lens { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: 1rem; }
.pac-lens-l { font-size: .85rem; font-weight: 800; color: var(--dim); margin-right: .2rem; }
.lensbtn { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .75rem 0 .35rem; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--strong) 4%, transparent); cursor: pointer; color: var(--ink2); font-weight: 800; font-size: .82rem; }
.lensbtn .seal { height: 1.9rem; min-width: 2.2rem; font-size: .95rem; }
.lensbtn[aria-pressed="true"] { border-color: var(--strong); background: color-mix(in srgb, var(--strong) 12%, transparent); color: var(--strong); }
.lensbtn i.sw { width: 12px; height: 12px; border-radius: 4px; background: var(--gc); margin-left: .4rem; }
/* แผงรายละเอียดชนิด */
.tdetail { --gc: var(--g-saman); position: sticky; top: 76px; display: flex; flex-direction: column; gap: .8rem; padding: 1.15rem; border-radius: 18px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--gc) 45%, transparent); }
.tdetail-h { display: flex; align-items: center; gap: .6rem; }
.tdetail-num { display: grid; place-items: center; flex: none; width: 2.8rem; height: 2.8rem; border-radius: 14px; background: var(--gc); color: var(--bg); font-weight: 800; font-size: 1.2rem; }
.tdetail-name { font-size: 1.3rem; font-weight: 800; color: var(--strong); line-height: 1.25; }
.tdetail-mean { font-size: .88rem; font-weight: 800; color: var(--gc); }
.tdetail-count { display: flex; align-items: baseline; gap: .4rem; font-weight: 800; color: var(--ink2); }
.tdetail-count b { font-size: 2rem; color: var(--gold); line-height: 1; }
.seal-rows { display: flex; flex-direction: column; gap: .35rem; }
.seal-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.memo { margin: 0; padding: .65rem .8rem; border-radius: 12px; background: color-mix(in srgb, var(--gold) 9%, transparent); color: var(--quote); font-weight: 700; font-size: .92rem; line-height: 1.6; }
.memo-l { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .05em; color: var(--gold); margin-bottom: .1rem; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem .8rem; margin: 0; font-size: .9rem; }
.kv dt { color: var(--dim); font-weight: 700; white-space: nowrap; }
.kv dd { margin: 0; font-weight: 700; color: var(--ink); min-width: 0; }
.kv dd.pali { white-space: normal; font-size: 1.02rem; }
.tdetail-words { display: flex; flex-wrap: wrap; gap: .35rem; }
.wbtn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 .75rem; border-radius: 10px; border: 1px solid var(--line); background: color-mix(in srgb, var(--strong) 4%, transparent); cursor: pointer;
	font-family: var(--f-pali); font-weight: 800; font-size: 1.05rem; color: var(--strong); white-space: nowrap; }
.wbtn:hover, .wbtn[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.tdetail .uf { margin-top: .2rem; }
.tdetail .story { font-size: 1.12rem; }
/* แผนที่เรื่อง ๓ กลุ่ม */
.smap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; align-items: start; }
.smap-g { display: flex; flex-direction: column; gap: .45rem; padding: 1rem; border-radius: 18px; background: linear-gradient(160deg, var(--bg2), var(--bg3)); border: 1px solid var(--line); }
.smap-h { display: flex; align-items: center; gap: .5rem; font-weight: 800; color: var(--strong); font-size: 1rem; margin-bottom: .2rem; }
.smap-h i { color: var(--gold); }
.smap-i { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .6rem; padding: .5rem .6rem; border-radius: 12px; background: color-mix(in srgb, var(--strong) 4%, transparent); align-items: center; }
.smap-i .tchip { grid-row: span 2; align-self: start; }
.smap-ask { font-size: .86rem; font-weight: 700; color: var(--ink2); line-height: 1.45; }
.smap-gloss { font-size: .82rem; font-weight: 800; color: var(--gold); }
/* ลองคิดทันที */
.tries { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.try { display: flex; flex-direction: column; gap: .45rem; padding: .9rem 1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); text-align: left; cursor: pointer; min-height: 9rem; }
.try:hover { border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.try-n { font-size: .72rem; font-weight: 800; color: var(--dim); }
.try-s { font-size: 1.15rem; font-weight: 800; color: var(--strong); line-height: 1.4; }
.try-q { font-size: .8rem; font-weight: 700; color: var(--gold); margin-top: auto; }
.try-a { display: none; flex-direction: column; gap: .35rem; font-size: .86rem; color: var(--ink2); line-height: 1.55; }
.try.shown .try-a { display: flex; }
.try.shown .try-q { display: none; }

/* ══════════ ด่าน ๒ คำสังเกต ══════════ */
.hunt { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: .7rem; }
.hunt-c { display: flex; flex-direction: column; gap: .55rem; padding: .9rem 1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.hunt-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.hunt-word { font-size: 1.45rem; color: var(--strong); }
.hunt-toks { display: flex; flex-wrap: wrap; gap: .35rem; }
.htk { min-height: 44px; padding: 0 .8rem; border-radius: 10px; border: 1px solid var(--line); background: color-mix(in srgb, var(--strong) 5%, transparent); cursor: pointer;
	font-family: var(--f-pali); font-weight: 800; font-size: 1.15rem; color: var(--ink); white-space: nowrap; }
.htk:hover:not(:disabled) { border-color: var(--gold); }
.htk.is-sig { color: var(--r-sig); border-color: var(--r-sig); background: color-mix(in srgb, var(--r-sig) 12%, transparent); }
.htk.is-miss { border-color: var(--bad); color: var(--bad); }
.htk.is-base { color: var(--r-base); }
.htk:disabled { cursor: default; }
.hunt-fin { font-family: var(--f-pali); font-weight: 800; font-size: 1.15rem; color: var(--dim); align-self: center; white-space: nowrap; }
.hunt-v { font-size: .86rem; font-weight: 700; color: var(--muted); min-height: 1.4em; }
.hunt-v.ok { color: var(--ok); }
.sigboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.sigc { --gc: var(--g-saman); display: flex; flex-direction: column; gap: .5rem; padding: .9rem 1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--gc); }
.sigc-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; }
.sigc-sig { font-family: var(--f-pali); font-size: 1.35rem; font-weight: 800; color: var(--r-sig); white-space: normal; }
.sigc-note { margin: 0; font-size: .88rem; color: var(--ink2); }
.sigc-ex { display: flex; flex-direction: column; gap: .3rem; }
.sigc-ex .story { font-size: 1.05rem; gap: .1rem .45rem; }
.traps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.trap { display: flex; flex-direction: column; gap: .55rem; padding: 1rem; border-radius: 16px; background: color-mix(in srgb, var(--r-sig) 6%, var(--panel)); border: 1px solid color-mix(in srgb, var(--r-sig) 35%, transparent); }
.trap-h { display: flex; align-items: center; gap: .5rem; font-weight: 800; }
.trap-h .pali { font-size: 1.4rem; color: var(--r-sig); }
.trap-row { display: flex; flex-direction: column; gap: .2rem; padding: .45rem .6rem; border-radius: 10px; background: color-mix(in srgb, var(--strong) 4%, transparent); }
.trap-row .story { font-size: 1rem; }

/* ══════════ ด่าน ๓ แม่แบบ ══════════ */
.cases { display: flex; flex-direction: column; gap: 1rem; }
.case-g { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.case-h { position: sticky; top: 76px; display: flex; flex-direction: column; gap: .2rem; padding: .8rem .9rem; border-radius: 14px; background: color-mix(in srgb, var(--r-base) 10%, transparent); border: 1px solid color-mix(in srgb, var(--r-base) 35%, transparent); }
.case-h b { font-size: 1.2rem; color: var(--r-base); font-weight: 800; }
.case-h span { font-size: .78rem; color: var(--muted); font-weight: 700; }
.tpl-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.tpl { --gc: var(--g-saman); display: flex; flex-direction: column; gap: .55rem; padding: .9rem 1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--gc); }
.tpl-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.tpl-form { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.slot { display: inline-flex; align-items: center; min-height: 34px; padding: 0 .6rem; border-radius: 9px; font-weight: 800; font-size: .86rem; white-space: nowrap; }
.slot-base { border: 1.5px dashed var(--r-base); color: var(--r-base); }
.slot-sig { background: color-mix(in srgb, var(--r-sig) 14%, transparent); color: var(--r-sig); font-family: var(--f-pali); font-size: 1.02rem; }
.slot-fin { border: 1.5px dashed color-mix(in srgb, var(--strong) 40%, transparent); color: var(--ink2); }
.tpl-ex .story { font-size: 1.1rem; }
.tpl-note { margin: 0; font-size: .82rem; color: var(--quote); }

/* ══════════ ด่าน ๔ แกะรอยปัจจัย ══════════ */
.method { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; counter-reset: m; }
.mstep { position: relative; display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1rem .9rem 3.3rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); counter-increment: m; }
.mstep::before { content: counter(m, thai); position: absolute; left: .9rem; top: .95rem; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--gold); color: var(--on-gold); font-weight: 800; }
.mstep b { font-size: 1rem; color: var(--strong); }
.mstep span { font-size: .86rem; color: var(--muted); line-height: 1.5; }
.lab { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.2rem; align-items: start; }
.lab-words { display: flex; flex-direction: column; gap: .7rem; }
.lab-g { display: flex; flex-direction: column; gap: .35rem; }
.lab-g .tchip { align-self: flex-start; }
.lab-detail { position: sticky; top: 76px; display: flex; flex-direction: column; gap: .7rem; padding: 1.1rem; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.lab-word { font-size: 2.6rem; color: var(--strong); text-align: center; line-height: 1.35; padding: .3rem 0; border-radius: 14px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 70%); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; counter-reset: st; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 1.7rem minmax(0, 1fr); gap: .05rem .6rem; align-items: baseline; padding: .5rem .6rem; border-radius: 12px; background: color-mix(in srgb, var(--strong) 4%, transparent); border: 1px solid var(--line); }
.steps li::before { content: counter(st, thai); grid-row: span 2; align-self: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--on-gold); font-weight: 800; font-size: .85rem; }
.steps-q { font-size: .76rem; font-weight: 700; color: var(--dim); }
.steps-a { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .95rem; font-weight: 800; color: var(--strong); line-height: 1.45; }
.steps-a .story { font-size: 1.05rem; }
.vud { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 1.4rem; padding: 1.2rem; border-radius: 18px; background: linear-gradient(160deg, var(--bg2), var(--bg3)); border: 1px solid var(--line); }
.vud-l { font-size: .78rem; font-weight: 800; color: var(--gold); letter-spacing: .04em; }
.vud-t { font-size: 1.25rem; font-weight: 800; color: var(--strong); margin: .1rem 0 .3rem; }
.vud-p { margin: 0; color: var(--ink2); font-size: .95rem; }
.vud-forms { display: flex; gap: .5rem; align-items: center; }
.vform { display: flex; align-items: center; gap: .35rem; padding: .55rem .8rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-weight: 800; font-size: 1.3rem; white-space: nowrap; }
.vform i { font-size: .8rem; color: var(--dim); }
.vform strong { color: var(--gold); }
.vud-cases { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.vcase { display: flex; flex-direction: column; gap: .45rem; padding: .85rem .95rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.vcase.yes { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.vcase-h { display: flex; gap: .45rem; align-items: baseline; font-size: .88rem; font-weight: 800; color: var(--ink); line-height: 1.45; }
.vcase-h i { color: var(--dim); } .vcase.yes .vcase-h i { color: var(--ok); }
.vcase-x { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; font-family: var(--f-pali); font-weight: 800; font-size: 1.08rem; }
.vcase-x .src { color: var(--r-base); } .vcase-x .out { color: var(--strong); } .vcase-x .op { color: var(--dim); font-family: var(--f-body); }
.vcase-x .seal { height: 1.7rem; min-width: 2rem; font-size: .9rem; padding: 0 .45rem; }
.vcase small { font-size: .78rem; color: var(--muted); font-weight: 700; }
.vud-note { grid-column: 1 / -1; margin: 0; font-size: .92rem; color: var(--quote); font-weight: 700; }
.tails { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .7rem; }
.tailc { display: flex; flex-direction: column; gap: .5rem; padding: .9rem 1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.tailc-h { display: flex; align-items: center; gap: .5rem; }
.tailc-h .tail { font-family: var(--f-pali); font-weight: 800; font-size: 1.4rem; color: var(--gold); }
.tailc-w { display: flex; flex-wrap: wrap; gap: .3rem .7rem; font-family: var(--f-pali); font-weight: 800; font-size: 1.12rem; color: var(--ink2); }
.tailc-w u { text-decoration: none; color: var(--gold); border-bottom: 2px solid var(--gold); }
.cross { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.crossc { display: flex; flex-direction: column; gap: .6rem; padding: 1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.crossc-h { display: flex; align-items: center; gap: .55rem; font-weight: 800; }
.crossc-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .5rem; }
.crossc-col { --gc: var(--g-saman); display: flex; flex-direction: column; gap: .35rem; padding: .6rem .7rem; border-radius: 12px; background: color-mix(in srgb, var(--gc) 7%, transparent); border: 1px solid color-mix(in srgb, var(--gc) 30%, transparent); }
.crossc-col .pali { font-size: 1.12rem; color: var(--strong); }
.crossc-col span { font-size: .8rem; font-weight: 700; color: var(--muted); }

/* ══════════ ด่าน ๕ คำแปล ══════════ */
.glosses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; align-items: start; }
.glist { display: flex; flex-direction: column; gap: 1.2rem; }
.glist-g { display: flex; flex-direction: column; gap: .5rem; }
.glist-h { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; }
.glist-h .smap-gloss { font-size: .9rem; }
.mrows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.mrow { display: flex; flex-direction: column; gap: .1rem; padding: .55rem .8rem; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-align: left; cursor: default; }
.mrow .pali { font-size: 1.2rem; color: var(--strong); }
.mrow-m { font-size: .9rem; font-weight: 700; color: var(--ink2); line-height: 1.45; transition: filter .25s; }
.hide .mrow { cursor: pointer; }
.hide .mrow-m { filter: blur(6px); user-select: none; }
.hide .mrow.shown .mrow-m { filter: none; }

/* ══════════ ด่าน ๖ แบบฟอร์ม ══════════ */
.fpattern { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; padding: 1rem 1.1rem; border-radius: 18px; background: linear-gradient(160deg, var(--bg2), var(--bg3)); border: 1px solid var(--line); font-weight: 800; font-size: 1.05rem; }
.fp { display: inline-flex; flex-direction: column; align-items: flex-start; gap: .05rem; padding: .45rem .75rem; border-radius: 12px; border: 1.5px solid var(--line); }
.fp small { font-size: .68rem; color: var(--dim); font-weight: 800; letter-spacing: .04em; }
.fp-1 { border-color: color-mix(in srgb, var(--gold) 60%, transparent); } .fp-1 small { color: var(--gold); }
.fp-2 { border-color: color-mix(in srgb, var(--g-saman) 60%, transparent); } .fp-2 small { color: var(--g-saman); }
.fp-3 { border-color: color-mix(in srgb, var(--r-base) 60%, transparent); } .fp-3 small { color: var(--r-base); }
.fp-w { font-family: var(--f-pali); font-size: 1.3rem; color: var(--strong); }
.fp-note { margin: .7rem 0 0; color: var(--muted); font-size: .9rem; }
.ftabs { margin-bottom: 1rem; }
.fwork { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.2rem; align-items: start; }
.fq { padding: 1rem 1.1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.fq-l { font-size: .76rem; font-weight: 800; color: var(--dim); }
.fq-t { margin: .2rem 0 0; font-size: 1.1rem; font-weight: 800; color: var(--strong); line-height: 1.55; }
.fslots { display: flex; flex-direction: column; gap: .55rem; margin-top: .9rem; }
.fslot { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .3rem .7rem; padding: .7rem .8rem; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--strong) 3%, transparent); }
.fslot-n { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: color-mix(in srgb, var(--strong) 10%, transparent); color: var(--dim); font-weight: 800; }
.fslot.done .fslot-n { background: var(--ok); color: var(--bg); }
.fslot.now { border-color: var(--gold); }
.fslot.now .fslot-n { background: var(--gold); color: var(--on-gold); }
.fslot-b { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.fslot-ans { font-family: var(--f-pali); font-size: 1.2rem; font-weight: 800; color: var(--strong); white-space: normal; }
.fslot-why { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.55; }
.fslot-ch { display: flex; flex-wrap: wrap; gap: .4rem; }
.fslot-ch button { min-height: 44px; padding: 0 .9rem; border-radius: 12px; border: 1.5px solid var(--line); background: color-mix(in srgb, var(--strong) 4%, transparent); cursor: pointer; font-family: var(--f-pali); font-weight: 800; font-size: 1.05rem; color: var(--ink); white-space: nowrap; }
.fslot-ch button:hover:not(:disabled) { border-color: var(--gold); }
.fslot-ch button.is-wrong { border-color: var(--bad); color: var(--bad); }
.fslot.locked { opacity: .45; }
.fanswer { position: sticky; top: 76px; display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem; border-radius: 18px; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 70%), var(--panel); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.fanswer-l { font-size: .76rem; font-weight: 800; color: var(--gold); }
.fanswer-t { font-family: var(--f-pali); font-size: 1.25rem; font-weight: 800; color: var(--strong); line-height: 1.7; white-space: normal; }
.fanswer-t .ph { color: var(--dim); font-family: var(--f-body); font-weight: 700; font-size: 1rem; }
.fanswer-t .on { color: var(--gold); }
.fbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.realans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.ra { display: flex; flex-direction: column; gap: .4rem; padding: .9rem 1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.ra-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; }
.ra-w { font-size: 1.4rem; color: var(--strong); }
.ra-a { text-align: left; padding: .55rem .75rem; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--gold) 26%, transparent); background: color-mix(in srgb, var(--gold) 6%, transparent);
	font-family: var(--f-pali); font-weight: 700; font-size: 1.05rem; line-height: 1.75; color: var(--ink); white-space: normal; transition: filter .25s; cursor: default; }
.ra-a b { color: var(--gold); }
.hide .ra-a { filter: blur(7px); cursor: pointer; user-select: none; }
.hide .ra-a.shown { filter: none; }

/* ══════════ ด่าน ๙ คลังการ์ด ══════════ */
.deck-ctl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-bottom: 1rem; }
.def-meter { display: flex; align-items: center; gap: .9rem; flex: 1 1 300px; }
.def-mtxt { flex: none; font-weight: 800; color: var(--gold); font-size: .95rem; }
.def-bar { flex: 1; height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--strong) 8%, transparent); overflow: hidden; }
.def-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--gold) 60%, #fff)); transition: width .4s ease; }
.deck-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.deck-filters select { min-height: 44px; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 800; font-size: .9rem; }
.deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.dcard { --gc: var(--g-saman); display: flex; flex-direction: column; gap: .35rem; perspective: 900px; }
.dcard-in { position: relative; height: 16.5rem; padding: 0; border: 0; background: none; cursor: pointer; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2,.7,.3,1); color: inherit; text-align: left; }
.dcard.flip .dcard-in { transform: rotateY(180deg); }
.dface { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column;
	border: 1px solid color-mix(in srgb, var(--gc) 40%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--gc) 13%, var(--bg2)), var(--bg3)); }
.dfront { align-items: center; justify-content: center; gap: .6rem; padding: .8rem; }
.dw { font-size: 2.1rem; color: var(--strong); line-height: 1.35; white-space: nowrap; }
.dfront .seal { font-size: 1rem; }
.dhint { font-size: .74rem; font-weight: 700; color: var(--dim); }
.dback { transform: rotateY(180deg); padding: .8rem; gap: .45rem; overflow: auto; }
.dback-top { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.dback-w { font-size: 1.3rem; color: var(--strong); }
.dback-m { font-size: .92rem; font-weight: 800; color: var(--ink); line-height: 1.45; }
.dback .story { font-size: 1rem; gap: .05rem .4rem; line-height: 1.55; }
.dback .qa-exams { margin-top: auto; }
.dknown { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--dim); font-weight: 800; font-size: .8rem; cursor: pointer; }
.dknown[aria-pressed="true"] { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.dcard.is-known .dface { box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 60%, transparent); }
.empty { padding: 2rem 1rem; border-radius: 16px; border: 1px dashed var(--line); text-align: center; color: var(--muted); font-weight: 700; }

/* ══════════ เกม (taddhita-play.js) ══════════ */
#play-root { display: flex; flex-direction: column; gap: 1rem; padding-block: 1.4rem 4rem; max-width: 900px; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.4rem; padding: 1.4rem; border-radius: 20px; background: linear-gradient(160deg, var(--bg2), var(--bg3)); border: 1px solid var(--line); }
.intro-h { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 800; margin: .1rem 0 .8rem; }
.rules { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .55rem; }
.rules li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .6rem; align-items: baseline; color: var(--ink2); font-size: .95rem; }
.rules i { color: var(--gold); text-align: center; }
.intro-shapes { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.intro-shapes span { padding: .1rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 800; border: 1px solid var(--line); color: var(--ink2); }
.intro-r { display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.intro-r .btn { flex: none; }
.intro-best-l { font-size: .78rem; font-weight: 800; color: var(--dim); }
.intro-best { font-size: 1.2rem; font-weight: 800; color: var(--strong); }
.intro-plays { font-size: .8rem; color: var(--dim); }
.stars { display: inline-flex; justify-content: center; gap: .15rem; font-size: 1.4rem; line-height: 1; color: color-mix(in srgb, var(--strong) 16%, transparent); }
.stars .on { color: var(--gold); text-shadow: 0 0 18px color-mix(in srgb, var(--gold) 55%, transparent); }
.stars-big { font-size: 2.6rem; }
.result .stars .on { animation: star-pop .55s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: var(--d); }
@keyframes star-pop { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
.play-toggles { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.ptog { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--strong) 4%, transparent); color: var(--dim); font-weight: 800; font-size: .82rem; cursor: pointer; }
.ptog[aria-pressed="true"] { color: var(--ink2); } .ptog[aria-pressed="true"] i { color: var(--gold); }
.def-meter.boss { margin-top: .4rem; }
/* แถบสถานะ */
.hud { position: sticky; top: 60px; z-index: 6; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .9rem; padding: .6rem .9rem; border-radius: 16px;
	background: color-mix(in srgb, var(--bg2) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); }
.hud-hearts { display: flex; gap: .1rem; font-size: 1.45rem; line-height: 1; color: #f43f5e; }
.heart.lost { color: color-mix(in srgb, var(--strong) 14%, transparent); animation: heart-break .5s ease; }
@keyframes heart-break { 0% { transform: scale(1.4); color: #f43f5e; } 100% { transform: none; } }
.hud-prog { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.hud-n { font-size: .78rem; font-weight: 800; color: var(--dim); }
.hud-bar { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--strong) 8%, transparent); overflow: hidden; }
.hud-bar span { display: block; height: 100%; background: var(--gold); border-radius: inherit; transition: width .35s ease; }
.hud-score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.hud-pts { font-size: 1.3rem; font-weight: 800; color: var(--strong); font-variant-numeric: tabular-nums; }
.hud-score span, .hud-combo span { font-size: .7rem; font-weight: 700; color: var(--dim); }
.hud-combo { display: grid; grid-template-columns: auto auto; column-gap: .35rem; align-items: center; padding: .25rem .7rem; border-radius: 12px; border: 1px solid var(--line); color: var(--dim); }
.hud-combo i { grid-row: span 2; font-size: 1.15rem; }
.hud-combo b { font-size: 1rem; font-weight: 800; color: var(--ink2); }
.hud-combo.hot { border-color: color-mix(in srgb, var(--r-sig) 60%, transparent); background: color-mix(in srgb, var(--r-sig) 14%, transparent); }
.hud-combo.hot i, .hud-combo.hot b { color: var(--r-sig); }
.hud-combo.hot i { animation: flame 1s ease-in-out infinite alternate; }
@keyframes flame { from { transform: scale(1) rotate(-6deg); } to { transform: scale(1.18) rotate(6deg); } }
/* การ์ดโจทย์ */
.qcard { position: relative; display: flex; flex-direction: column; align-items: center; gap: .9rem; padding: 1.3rem 1.3rem 1.4rem; border-radius: 22px; text-align: center;
	background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--gold) 9%, transparent), transparent 60%), linear-gradient(160deg, var(--bg2), var(--bg3)); border: 1px solid var(--line); }
.qcard.gold { border-color: color-mix(in srgb, var(--gold) 70%, transparent); box-shadow: 0 0 0 1px var(--gold) inset, 0 0 40px -12px var(--gold); }
.qcard.shake { animation: shake .42s ease; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.qtop { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.qtag { display: inline-block; padding: .1rem .7rem; border-radius: 999px; font-size: .76rem; font-weight: 800; background: color-mix(in srgb, var(--strong) 10%, transparent); color: var(--ink2); }
.qgold { padding: .1rem .7rem; border-radius: 999px; font-size: .76rem; font-weight: 800; background: var(--gold); color: var(--on-gold); }
.qchain { padding: .1rem .7rem; border-radius: 999px; font-size: .76rem; font-weight: 800; border: 1px solid var(--gold); color: var(--gold); }
.qtimer { width: 100%; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--strong) 8%, transparent); overflow: hidden; }
.qtimer span { display: block; height: 100%; background: var(--r-base); transform-origin: left; transition: transform .08s linear, background-color .3s; }
.qtimer.low span { background: #f43f5e; }
.qprompt { display: flex; flex-direction: column; align-items: center; gap: .5rem; width: 100%; }
.qword { font-size: clamp(2.6rem, 9vw, 4.2rem); line-height: 1.35; color: var(--strong); text-shadow: 0 6px 30px color-mix(in srgb, var(--gold) 28%, transparent); }
.qword-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.qtext { margin: 0; font-size: clamp(1.25rem, 3.4vw, 1.8rem); font-weight: 800; color: var(--strong); line-height: 1.45; }
.qtext-long { font-size: clamp(1.05rem, 2.6vw, 1.3rem); line-height: 1.6; max-width: 36em; }
.qprompt .story { justify-content: center; font-size: clamp(1.25rem, 3.6vw, 1.75rem); }
.qtray { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .3rem .5rem; min-height: 3.2rem; padding: .5rem .8rem; border-radius: 14px; border: 1.5px dashed color-mix(in srgb, var(--gold) 45%, transparent); width: 100%; max-width: 40rem; }
.qtray .tk { font-family: var(--f-pali); font-weight: 800; font-size: 1.4rem; }
.qtray .tk.bad { color: var(--bad); text-decoration: line-through; }
.qtray-ph { color: var(--dim); font-weight: 700; font-size: .9rem; align-self: center; }
.qask { margin: 0; font-size: 1rem; font-weight: 800; color: var(--gold); }
.qtrail { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.qtrail-i { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .65rem; border-radius: 999px; font-size: .86rem; font-weight: 800; }
.qtrail-i.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.qtrail-i.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.qtrail-i .pali { font-size: 1rem; }
/* ตัวเลือก */
.choices { display: grid; gap: .6rem; width: 100%; }
.ch-two { grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); }
.ch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ch-list { grid-template-columns: 1fr; }
.ch-seals, .ch-coins, .ch-words { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ch-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.choice { --tc: var(--gold); position: relative; display: flex; align-items: center; gap: .7rem; min-height: 64px; padding: .7rem 1rem; border-radius: 16px; cursor: pointer; text-align: left;
	border: 1.5px solid var(--line); background: color-mix(in srgb, var(--strong) 4%, transparent); color: var(--ink); font: inherit; font-weight: 800; transition: transform .15s ease, border-color .2s, background-color .2s; }
.choice:hover:not(:disabled) { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tc) 70%, transparent); background: color-mix(in srgb, var(--tc) 9%, transparent); }
.choice:active:not(:disabled) { transform: scale(.97); }
.choice:disabled { cursor: default; }
.ckey { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 8px; display: grid; place-items: center; font-size: .78rem; color: var(--dim); border: 1px solid var(--line); }
.cbody { display: flex; flex-direction: column; min-width: 0; }
.ctext { font-size: 1.08rem; line-height: 1.4; }
.ctext.pali { font-size: 1.25rem; white-space: normal; }
.csub { font-size: .76rem; font-weight: 700; color: var(--dim); line-height: 1.35; }
.ch-two .choice, .ch-seals .choice, .ch-coins .choice, .ch-words .choice { flex-direction: column; justify-content: center; text-align: center; gap: .3rem; }
.ch-two .choice { min-height: 108px; }
.ch-two .ctext { font-size: 1.35rem; }
.ch-seals .ckey, .ch-coins .ckey, .ch-words .ckey { position: absolute; top: .45rem; left: .45rem; }
.ch-seals .choice { min-height: 104px; }
.ch-seals .ctext { display: inline-grid; place-items: center; min-width: 4rem; padding: .3rem .8rem; border-radius: 12px; background: var(--gold); color: var(--on-gold); font-size: 1.6rem; white-space: nowrap; }
.ch-words .choice { min-height: 96px; }
.ch-words .ctext { font-size: clamp(1.15rem, 3vw, 1.5rem); white-space: nowrap; }
.ch-coins .choice { min-height: 96px; border-radius: 50%; aspect-ratio: 1; max-width: 120px; margin-inline: auto; width: 100%; }
.ch-coins .ctext { font-size: 2rem; color: var(--gold); }
.ch-list .choice { min-height: 56px; }
.ch-list .ctext { font-size: .98rem; font-weight: 700; line-height: 1.6; }
.ch-list .ctext.pali { font-size: 1.15rem; }
.ch-tiles .choice { min-height: 52px; padding: .4rem 1rem; border-radius: 12px; }
.ch-tiles .ckey { display: none; }
.ch-tiles .ctext { font-size: 1.3rem; white-space: nowrap; }
.choice.is-right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 18%, transparent); animation: pop .35s ease; }
.choice.is-right::after { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; top: .5rem; right: .6rem; color: var(--ok); }
.choice.is-wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 16%, transparent); }
.choice:disabled:not(.is-right):not(.is-wrong) { opacity: .45; }
@keyframes pop { 50% { transform: scale(1.05); } }
/* เฉลย */
.qexp { width: 100%; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.qexp:empty { display: none; }
.qexp-h { display: inline-flex; align-items: center; gap: .45rem; font-size: 1.1rem; font-weight: 800; }
.qexp-h.ok { color: var(--ok); } .qexp-h.bad { color: var(--bad); }
.qexp-h .pali { font-size: 1.15rem; }
.qexp-t { margin: 0; max-width: 40em; padding: .7rem 1rem; border-radius: 14px; background: color-mix(in srgb, var(--gold) 7%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent); color: var(--ink2); font-weight: 600; line-height: 1.7; }
.qexp .uf { width: 100%; max-width: 40rem; text-align: left; }
.qexp .roles { justify-content: center; font-size: .78rem; }
.qnext-bar { display: flex; justify-content: center; }
.qnext-bar:empty { display: none; }
.btn-next { flex: 0 1 360px; }
.burst { position: fixed; z-index: 50; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: spark .7s ease-out forwards; }
.burst i:nth-child(3n) { background: var(--r-base); } .burst i:nth-child(3n+1) { background: var(--r-sig); }
@keyframes spark { from { transform: rotate(var(--a)) translateY(0) scale(1); opacity: 1; } to { transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(.3); opacity: 0; } }
.burst-pts { position: absolute; left: 50%; top: -10px; transform: translateX(-50%); white-space: nowrap; font-size: 1.5rem; font-weight: 800; color: var(--gold); text-shadow: 0 2px 12px rgba(0,0,0,.4); animation: rise .9s ease-out forwards; }
@keyframes rise { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -60px); opacity: 0; } }
/* ผล */
.result { display: flex; flex-direction: column; align-items: center; gap: .8rem; padding: 1.6rem 1.3rem; border-radius: 22px; text-align: center;
	background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 65%), linear-gradient(160deg, var(--bg2), var(--bg3)); border: 1px solid var(--line); }
.result-h { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; }
.result-note { margin: 0; color: var(--muted); font-size: .9rem; max-width: 32em; }
.result-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; width: 100%; max-width: 640px; }
.rstat { display: flex; flex-direction: column; gap: .1rem; padding: .7rem .4rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.rstat b { font-size: 1.5rem; font-weight: 800; color: var(--strong); font-variant-numeric: tabular-nums; }
.rstat span { font-size: .76rem; font-weight: 700; color: var(--dim); }
.rstat.best { border-color: var(--gold); } .rstat.best span { color: var(--gold); }
.result-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; width: 100%; }
.result-acts .btn { flex: 0 1 auto; }
.miss { display: flex; flex-direction: column; gap: .6rem; }
.miss-h { font-size: 1.1rem; font-weight: 800; }
.miss-i { display: grid; grid-template-columns: minmax(6rem, auto) minmax(0, 1fr); gap: .9rem; align-items: start; padding: .9rem 1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.miss-q { display: grid; place-items: center; min-height: 4rem; padding: 0 .6rem; border-radius: 12px; background: color-mix(in srgb, var(--strong) 5%, transparent); }
.miss-big { font-size: 1.5rem; color: var(--gold); line-height: 1.3; }
.miss-t { margin: .35rem 0 0; font-weight: 800; color: var(--strong); }
.miss-e { margin: .3rem 0 0; color: var(--ink2); font-size: .92rem; line-height: 1.65; }

/* ══════════ จอแคบ ══════════ */
@media (max-width: 1000px) {
	.pboard, .lab, .fwork { grid-template-columns: 1fr; }
	.tdetail, .lab-detail, .fanswer { position: static; }
	.tdetail { order: -1; }
	.tries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.method { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.glosses, .traps { grid-template-columns: 1fr; }
	.lanterns { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
	.squeeze { grid-template-columns: 1fr; }
	.sq-arrow { transform: rotate(90deg); justify-self: center; }
	.tree { grid-template-columns: 1fr; }
	.teq { display: none; }
	.smap, .sigboard, .tpl-list, .cross, .qa-list, .realans, .vud-cases { grid-template-columns: 1fr; }
	.case-g { grid-template-columns: 1fr; gap: .5rem; }
	.case-h { position: static; flex-direction: row; align-items: baseline; gap: .6rem; }
	.mrows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.vud { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.hero-art { background-position: 74% 78%; }
	.hero::before { background: linear-gradient(0deg, var(--bg) 8%, color-mix(in srgb, var(--bg) 84%, transparent) 55%, color-mix(in srgb, var(--bg) 35%, transparent) 100%); }
	.hero-inner { padding-top: 6rem; }
	.hero-compact .hero-inner { padding-top: 4.5rem; }
	.hero-compact .hero-lead { display: none; }
	.td-bar-title { display: none; }
	.td-back span, .td-pill-link span, #theme-label { display: none; }
	.td-pill-link, .theme-btn { width: 44px; padding: 0; justify-content: center; }
	.dock .btn { min-height: 50px; padding: 0 1rem; font-size: .95rem; }
	.dock .btn-ghost { flex: 0 0 auto; }
	.btn-ghost span { display: none; }
	.tbranch { grid-template-columns: 1fr; gap: .4rem; }
	.lanterns { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.prow { grid-template-columns: 1.8rem minmax(0, 1fr) 2rem; gap: .2rem .55rem; padding: .55rem; }
	.prow-p { grid-column: 2 / -1; grid-row: 2; }
	.prow-n { width: 1.8rem; height: 1.8rem; }
	.tries, .method { grid-template-columns: 1fr; }
	.try { min-height: 0; }
	.hunt { grid-template-columns: 1fr; }
	.mrows { grid-template-columns: 1fr; }
	.uf-grid { grid-template-columns: 1fr; }
	.uf-cue span { display: none; }
	.story { font-size: 1.2rem; }
	.vud-forms { flex-wrap: wrap; }
	.deck { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
	.dcard-in { height: 16rem; }
	.dw { font-size: clamp(1.3rem, 6.5vw, 1.8rem); }
	.intro { grid-template-columns: 1fr; padding: 1rem; }
	.hud { grid-template-columns: auto minmax(0, 1fr) auto; gap: .6rem; }
	.hud-combo { grid-column: 1 / -1; justify-self: start; grid-template-columns: auto auto auto; grid-row: 2; padding: .15rem .6rem; }
	.hud-combo i { grid-row: auto; font-size: .95rem; }
	.ch-grid { grid-template-columns: 1fr; }
	.ch-seals, .ch-coins, .ch-words { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ch-two .choice { min-height: 92px; padding: .6rem .5rem; }
	.ch-two .ctext { font-size: 1.12rem; }
	.result-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.miss-i { grid-template-columns: 1fr; }
	.qcard { padding: 1rem .8rem 1.1rem; }
	.qprompt .story { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── แก้หลังดูภาพจริง ── */
.crossc-col .tchip, .lab-g .tchip, .trap-row .tchip { align-self: flex-start; }
.crossc.wide { grid-column: 1 / -1; }
.crossc.wide .crossc-cols { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tails { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.fp-note, .fq-t, .qtext.pali, .kv dd.pali { white-space: normal; }
.ftabs button { white-space: normal; text-align: left; line-height: 1.35; padding-block: .45rem; }
.fslot-ch button { white-space: normal; text-align: left; }
.tdetail, .lab-detail { scroll-margin-top: 72px; }
@media (max-width: 1000px) { .lab-detail { order: -1; } .lab { display: flex; flex-direction: column; } }
@media (max-width: 1000px) { .fwork { display: flex; flex-direction: column; } .fanswer { order: -1; } }
.tpl-list { grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
@media (max-width: 860px) { .tpl-list { grid-template-columns: 1fr; } }
