/* ห้องเรียนนามและสัพพนาม (/nama/<ด่าน>/study|play) — ชั้นบนสุดต่อจาก akkhara-map.css + akkhara-stage.css (+ akkhara-play.css)
   สีความหมาย (ใช้สีเดียวกันทุกที่: ผัง ป้าย คำสำคัญ ตัวเลือก):
     ลิงค์ ๓ — ปุงลิงค์ ฟ้า · อิตถีลิงค์ ชมพู · นปุงสกลิงค์ เขียว
     สัพพนาม — ปุริส คราม · อนิยม ส้ม · นิยม ม่วงบานเย็น
   คำบาลีในประโยค = ตัวหนาสีคราม (.pw) · คำแปล = เทา */
:root {
	--l-pung: #7cc4ff; --l-itthi: #f9a8d4; --l-napung: #6ee7b7;
	--s-purisa: #a5b4fc; --s-aniyama: #fdba74; --s-niyama: #f0abfc;
	--pali: #c7d2fe; --gloss: var(--muted);
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
	--l-pung: #1d4ed8; --l-itthi: #be185d; --l-napung: #047857;
	--s-purisa: #4338ca; --s-aniyama: #c2410c; --s-niyama: #a21caf;
	--pali: #3730a3;
} }
:root[data-theme="light"] {
	--l-pung: #1d4ed8; --l-itthi: #be185d; --l-napung: #047857;
	--s-purisa: #4338ca; --s-aniyama: #c2410c; --s-niyama: #a21caf;
	--pali: #3730a3;
}
.hero-art { background-image: url("/assets/game/hub/nama.jpg"); background-position: right 78%; }
@media (max-width: 640px) { .hero-art { background-position: 82% 60%; } }

.l-pung { --lc: var(--l-pung); } .l-itthi { --lc: var(--l-itthi); } .l-napung { --lc: var(--l-napung); } .l-none { --lc: var(--dim); }
.s-purisa { --sc: var(--s-purisa); } .s-aniyama { --sc: var(--s-aniyama); } .s-niyama { --sc: var(--s-niyama); }
.kw-pung { color: var(--l-pung); } .kw-itthi { color: var(--l-itthi); } .kw-napung { color: var(--l-napung); }
.kw-purisa { color: var(--s-purisa); } .kw-aniyama { color: var(--s-aniyama); } .kw-niyama { color: var(--s-niyama); }
.kw-eka, .kw-bahu { color: var(--strong); }
.h-n { font-style: normal; color: var(--gold); }
.sec h2 em { font-style: normal; color: var(--gold); }

/* คำบาลี */
.pali, .pw { font-family: "Thunder Pali", var(--f-body); }
.pw { font-weight: 800; color: var(--pali); white-space: nowrap; }
.lpill { display: inline-flex; align-items: center; gap: .3rem; padding: .08rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap;
	color: var(--lc); background: color-mix(in srgb, var(--lc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--lc) 40%, transparent); }
.gl-w { display: inline-flex; align-items: baseline; gap: .45rem; min-width: 0; }
.gl-w b { font-weight: 800; color: var(--pali); font-size: 1.08rem; white-space: nowrap; }
.gl-m { color: var(--gloss); font-size: .88rem; font-weight: 600; }
.mini-link { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; color: var(--gold); font-weight: 800; font-size: .88rem; text-decoration: none; }
.mini-link:hover { text-decoration: underline; }

/* ════ ด่าน ๑ แผนที่นามศัพท์ ════ */
.nm-board { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.4rem; align-items: start; }
.nm-maps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.nm-map { display: flex; flex-direction: column; gap: .8rem; padding: 1.1rem; border-radius: 18px; background: linear-gradient(160deg, var(--bg2), var(--bg3)); border: 1px solid var(--line); }
.nm-map-main { grid-column: 1 / -1; }
.nm-root { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.nm-node { display: inline-flex; align-items: center; gap: .55rem; min-height: 48px; padding: .45rem .9rem; border-radius: 14px; cursor: pointer; text-align: left;
	border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 800; transition: border-color .2s, transform .2s, opacity .25s; }
.nm-node:hover { border-color: color-mix(in srgb, var(--strong) 35%, transparent); transform: translateY(-1px); }
.nm-node[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.nm-node-n { display: grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 .3rem; border-radius: 10px; background: var(--gold); color: var(--on-gold); font-size: 1rem; }
.nm-node-t { font-size: 1.02rem; }
.nm-node.is-root .nm-node-t { font-size: 1.35rem; }
.nm-node.is-root .nm-node-n { min-width: 2.6rem; height: 2.6rem; font-size: 1.35rem; }
.nm-node.is-leaf { min-height: 44px; padding: .35rem .8rem; background: color-mix(in srgb, var(--strong) 4%, transparent); font-weight: 700; }
.nm-node .fa-award { color: var(--gold); font-size: .8rem; }
.nm-branches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.nm-branch { display: flex; flex-direction: column; gap: .55rem; padding: .8rem; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--strong) 16%, transparent); }
.nm-kids { display: flex; flex-wrap: wrap; gap: .4rem; padding-left: .9rem; border-left: 2px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.nm-sub { display: flex; flex-direction: column; gap: .4rem; }
.nm-detail { position: sticky; top: 76px; display: flex; flex-direction: column; gap: .7rem; padding: 1.2rem; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.nm-detail h3 { font-size: 1.5rem; font-weight: 800; color: var(--strong); }
.nm-detail .qa-q { font-size: .95rem; }
.nm-detail .qa-a { cursor: default; }
.nm-dpath { font-size: .8rem; font-weight: 700; color: var(--dim); }
.nm-wordlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .9rem; margin: 0; padding: 0; list-style: none; }
.nm-wordlist li { display: flex; align-items: baseline; gap: .45rem; padding: .2rem 0; border-bottom: 1px solid var(--line); min-width: 0; }
.nm-wordlist li b { font-weight: 800; color: var(--pali); white-space: nowrap; }
.nm-wordlist li span { color: var(--gloss); font-size: .86rem; }
.nm-wordlist.one { grid-template-columns: 1fr; }

/* สมการ ศัพท์ + วิภัตติ → รูป */
.nm-eq { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.2fr); gap: .7rem; align-items: stretch; }
.nm-eqbox { display: flex; flex-direction: column; justify-content: center; gap: .2rem; padding: .9rem 1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.nm-eqbox b { font-size: clamp(1.6rem, 3.6vw, 2.2rem); font-weight: 800; line-height: 1.3; color: var(--pali); white-space: nowrap; }
.nm-eqbox span { font-size: .82rem; font-weight: 700; color: var(--muted); }
.nm-eqbox.out { border-color: color-mix(in srgb, var(--gold) 60%, transparent); background: color-mix(in srgb, var(--gold) 8%, var(--panel)); }
.nm-eqbox.out b { color: var(--gold); }
.nm-eqbox .tr { font-size: 1.05rem; font-weight: 800; color: var(--strong); }
.nm-eqop { display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: var(--dim); }
.flow-3 { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); }
.flow-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fstep .fbody { margin: 0; color: var(--ink2); font-size: .93rem; line-height: 1.7; }
.four-9 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gl-l { --gc: var(--lc); }
.gl-card .chip-row .lpill { font-size: .86rem; padding: .2rem .7rem; }
.gl-card .gl-seal { font-size: 1.15rem; }

/* ════ ด่าน ๒ ผังการันต์ ════ */
.kb { display: flex; flex-direction: column; gap: .5rem; }
.kb-row { display: grid; grid-template-columns: 9.5rem repeat(var(--nv, 6), minmax(0, 1fr)); gap: .5rem; align-items: stretch; transition: opacity .25s; }
.kb-head .kb-v { font-size: .78rem; font-weight: 800; color: var(--dim); text-align: center; align-self: end; }
.kb-lab { display: flex; flex-direction: column; justify-content: center; gap: .1rem; padding: .4rem .7rem; border-radius: 12px; background: color-mix(in srgb, var(--lc) 12%, transparent); border-left: 4px solid var(--lc); }
.kb-lab b { font-size: 1rem; font-weight: 800; color: color-mix(in srgb, var(--lc) 75%, var(--ink)); white-space: nowrap; }
.kb-lab span { font-size: .76rem; font-weight: 700; color: var(--dim); }
.kb-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 5.4rem; padding: .4rem .2rem; border-radius: 14px; cursor: pointer; font: inherit;
	border: 1px solid color-mix(in srgb, var(--lc) 45%, transparent); background: color-mix(in srgb, var(--lc) 12%, transparent); color: var(--strong); transition: opacity .25s, transform .2s, box-shadow .2s; }
.kb-cell:hover { transform: translateY(-2px); }
.kb-cell[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--lc); }
.kb-cell .kv { font-family: "Thunder Pali", var(--f-body); font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 800; line-height: 1.25; color: var(--lc); }
.kb-cell .km { font-family: "Thunder Pali", var(--f-body); font-size: .9rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
.kb-slot { min-height: 5.4rem; border-radius: 14px; border: 1.5px dashed color-mix(in srgb, var(--lc) 35%, transparent); display: grid; place-items: center; color: var(--dim); font-size: .74rem; font-weight: 700; }
.kb.spot .kb-cell:not(.lit), .kb.spot .kb-slot:not(.lit) { opacity: .22; }
.kb.spot-row .kb-row:not(.lit):not(.kb-head) { opacity: .25; }
.ex-guess .ex-tap { display: none; }
.like-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.like-groups.guess { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.likeg { display: flex; flex-direction: column; gap: .5rem; padding: .9rem; border-radius: 16px; background: linear-gradient(160deg, color-mix(in srgb, var(--lc) 7%, var(--bg2)), var(--bg3)); border: 1px solid color-mix(in srgb, var(--lc) 28%, transparent); }
.likeg-h { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.likeg-h b { font-size: 1.15rem; font-weight: 800; color: var(--pali); }
.likeg-c { display: flex; flex-wrap: wrap; gap: .35rem; }
.likew { display: inline-flex; flex-direction: column; align-items: center; gap: .1rem; min-height: 44px; padding: .35rem .7rem; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font: inherit; color: var(--ink); cursor: default; }
.likew b { font-family: "Thunder Pali", var(--f-body); font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.likew small { font-size: .72rem; font-weight: 700; color: var(--dim); }
.guess .likew { cursor: pointer; }
.guess .likew:not(.shown) small { visibility: hidden; }
.guess .likew.shown { border-color: color-mix(in srgb, var(--lc) 55%, transparent); background: color-mix(in srgb, var(--lc) 12%, var(--panel)); }
.guess .likew.shown small { color: var(--lc); }

/* ════ ด่าน ๓ ตารางวิภัตติ ════ */
.vt { display: flex; flex-direction: column; gap: .45rem; }
.vt-row { display: grid; grid-template-columns: 2.6rem 6.4rem repeat(2, 5.4rem) minmax(0, 1fr) 11rem; gap: .5rem; align-items: center; padding: .45rem .55rem; border-radius: 14px;
	background: var(--panel); border: 1px solid var(--line); cursor: pointer; text-align: left; font: inherit; color: inherit; transition: opacity .25s, border-color .2s; }
.vt-row:hover { border-color: color-mix(in srgb, var(--strong) 30%, transparent); }
.vt-row[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.vt-head { background: none; border: 0; cursor: default; padding-block: 0; }
.vt-head span { font-size: .74rem; font-weight: 800; color: var(--dim); }
.vt-no { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 10px; background: var(--gold); color: var(--on-gold); font-weight: 800; }
.vt-name { font-weight: 800; font-size: 1.05rem; color: var(--strong); }
.vt-mark { display: grid; place-items: center; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--strong) 4%, transparent); cursor: pointer;
	font-family: "Thunder Pali", var(--f-body); font-size: 1.45rem; font-weight: 800; color: var(--pali); transition: opacity .25s, background-color .2s; }
.vt-mark.shared::after { content: "×" attr(data-n); font-family: var(--f-body); font-size: .62rem; font-weight: 800; color: var(--gold); margin-left: .2rem; align-self: start; }
.vt-mark.shared { display: flex; justify-content: center; align-items: center; }
.vt.spot .vt-mark:not(.lit) { opacity: .2; }
.vt-mark.lit { background: color-mix(in srgb, var(--gold) 18%, transparent); border-color: var(--gold); }
.vt-ayat { font-weight: 700; color: var(--ink2); font-size: .92rem; line-height: 1.45; }
.vt-karaka { font-size: .86rem; font-weight: 700; color: var(--muted); }
.vt-alap { opacity: .9; border-style: dashed; cursor: default; }
.mark-sum { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.ayat-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.ayat-chip { padding: .1rem .55rem; border-radius: 8px; background: color-mix(in srgb, var(--gold) 12%, transparent); color: var(--ink); font-weight: 800; font-size: .88rem; }

/* ════ ด่าน ๕ สัพพนาม ════ */
.sb-board { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1rem; align-items: start; }
.sb-card { display: flex; flex-direction: column; gap: .8rem; padding: 1.1rem; border-radius: 18px; background: linear-gradient(160deg, color-mix(in srgb, var(--sc) 8%, var(--bg2)), var(--bg3)); border: 1px solid color-mix(in srgb, var(--sc) 30%, transparent); }
.sb-head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.sb-seal { flex: none; white-space: nowrap; display: grid; place-items: center; height: 2.8rem; padding: 0 .9rem; border-radius: 14px; background: var(--sc); color: var(--on-seal); font-weight: 800; font-size: 1.05rem; }
.sb-sub { font-size: .9rem; font-weight: 700; color: var(--muted); }
.burut { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.burut-i { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .8rem .4rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.burut-i i { font-size: 1.3rem; color: var(--sc); }
.burut-i b { font-family: "Thunder Pali", var(--f-body); font-size: 1.6rem; font-weight: 800; color: var(--pali); line-height: 1.3; }
.burut-i .bl { font-size: .8rem; font-weight: 800; color: var(--sc); }
.burut-i .bm { font-size: .82rem; color: var(--gloss); font-weight: 600; }
.sb-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; }
.sb-group { display: flex; flex-direction: column; gap: .6rem; padding: .9rem; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--sc) 30%, transparent); background: color-mix(in srgb, var(--sc) 5%, transparent); }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .4rem; }
.sb-w { display: flex; flex-direction: column; gap: .05rem; padding: .45rem .65rem; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.sb-w b { font-family: "Thunder Pali", var(--f-body); font-weight: 800; font-size: 1.15rem; color: var(--pali); white-space: nowrap; }
.sb-w span { font-size: .8rem; color: var(--gloss); font-weight: 600; line-height: 1.4; }
.sb-w .two-home { align-self: flex-start; margin-top: .15rem; font-size: .66rem; font-weight: 800; color: var(--gold); }
.ruler { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; padding-top: 2.2rem; }
.ruler::before { content: ""; position: absolute; left: 1.2rem; right: 1.2rem; top: 1rem; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--sc), color-mix(in srgb, var(--sc) 15%, transparent)); }
.ruler-l, .ruler-r { position: absolute; top: 0; font-size: .72rem; font-weight: 800; color: var(--dim); }
.ruler-l { left: 0; } .ruler-r { right: 0; }
.ruler-i { position: relative; display: flex; flex-direction: column; align-items: center; gap: .1rem; text-align: center; padding: .55rem .3rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.ruler-i::before { content: ""; position: absolute; top: -1.55rem; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sc) 20%, transparent); }
.ruler-i b { font-family: "Thunder Pali", var(--f-body); font-size: 1.5rem; font-weight: 800; color: var(--pali); line-height: 1.3; }
.ruler-i .rm { font-size: .9rem; font-weight: 800; color: var(--strong); }
.ruler-i .rn { font-size: .74rem; font-weight: 600; color: var(--muted); line-height: 1.4; }
.ex-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; }
.ex-row { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); gap: .2rem .7rem; align-items: center; padding: .65rem .8rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.ex-row > b { grid-row: span 2; font-family: "Thunder Pali", var(--f-body); font-size: 1.4rem; font-weight: 800; color: var(--pali); white-space: nowrap; }
.ex-row .ex-a { justify-self: start; padding: .1rem .55rem; border-radius: 8px; border: 0; font: inherit; font-weight: 800; font-size: .88rem; color: var(--sc); background: color-mix(in srgb, var(--sc) 12%, transparent); cursor: default; transition: filter .25s; text-align: left; }
.ex-row .qa-exams { font-size: .72rem; }
.hide .ex-a { filter: blur(6px); cursor: pointer; }
.hide .ex-a.shown { filter: none; }

/* ════ ด่าน ๖ นิบาต ════ */
.nt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.nt-card { display: flex; flex-direction: column; gap: .55rem; padding: .9rem; border-radius: 16px; background: linear-gradient(160deg, var(--bg2), var(--bg3)); border: 1px solid var(--line); transition: opacity .25s; }
.nt-head { display: flex; align-items: center; gap: .55rem; }
.nt-seal { flex: none; white-space: nowrap; padding: .2rem .7rem; border-radius: 10px; background: var(--gold); color: var(--on-gold); font-weight: 800; font-size: .92rem; }
.nt-n { margin-left: auto; font-size: .74rem; font-weight: 800; color: var(--dim); white-space: nowrap; }
.nt-list { display: flex; flex-direction: column; gap: .15rem; margin: 0; padding: 0; list-style: none; }
.nt-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .5rem; align-items: baseline; padding: .28rem .1rem; border-bottom: 1px solid var(--line); transition: opacity .25s; }
.nt-list li:last-child { border-bottom: 0; }
.nt-list b { font-family: "Thunder Pali", var(--f-body); font-weight: 800; font-size: 1.08rem; color: var(--pali); white-space: nowrap; }
.nt-list .nm { font-size: .86rem; color: var(--gloss); font-weight: 600; transition: filter .25s; }
.nt-list .ny { font-size: .66rem; font-weight: 800; color: var(--gold); white-space: nowrap; }
.nt-alt { font-size: .66rem; font-weight: 800; color: var(--dim); }
.nt-grid.spot li:not(.lit) { opacity: .25; }
.hide .nm { filter: blur(6px); cursor: pointer; }
.hide .nm.shown { filter: none; }
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: .45rem; }
.up-i { display: flex; align-items: baseline; gap: .6rem; padding: .55rem .75rem; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.up-i b { flex: none; min-width: 2.8rem; font-family: "Thunder Pali", var(--f-body); font-size: 1.3rem; font-weight: 800; color: var(--pali); }
.up-i .nm { font-size: .88rem; color: var(--gloss); font-weight: 600; }

/* ════ ด่าน ๗ ตารางแจก ════ */
.dpick { display: flex; flex-direction: column; gap: .6rem; }
.dpick-g { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.dpick-l { flex: none; width: 8.2rem; font-size: .8rem; font-weight: 800; color: color-mix(in srgb, var(--lc) 75%, var(--ink)); }
.dchip { display: inline-flex; align-items: baseline; gap: .35rem; min-height: 44px; padding: .3rem .8rem; border-radius: 12px; cursor: pointer; font: inherit;
	border: 1px solid color-mix(in srgb, var(--lc) 40%, transparent); background: color-mix(in srgb, var(--lc) 8%, transparent); color: var(--ink); }
.dchip b { font-family: "Thunder Pali", var(--f-body); font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.dchip small { font-size: .72rem; font-weight: 700; color: var(--dim); }
.dchip[aria-pressed="true"] { background: var(--lc); border-color: var(--lc); color: var(--on-seal); }
.dchip[aria-pressed="true"] small { color: inherit; opacity: .8; }
.dt-board { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.2rem; align-items: start; margin-top: 1.2rem; }
.dt-wrap { padding: 1rem; border-radius: 18px; background: linear-gradient(160deg, color-mix(in srgb, var(--lc) 6%, var(--bg2)), var(--bg3)); border: 1px solid color-mix(in srgb, var(--lc) 28%, transparent); min-width: 0; }
.dt-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem .8rem; margin-bottom: .8rem; }
.dt-title b { font-family: "Thunder Pali", var(--f-body); font-size: 1.9rem; font-weight: 800; color: var(--pali); line-height: 1.2; }
.dt-title span { color: var(--gloss); font-weight: 700; }
.dt { display: grid; grid-template-columns: 6.6rem repeat(var(--nn, 2), minmax(0, 1fr)); gap: .35rem; }
.dt-h { font-size: .78rem; font-weight: 800; color: var(--dim); text-align: center; padding-bottom: .1rem; }
.dt-h.on { color: var(--gold); }
.dt-case { display: flex; align-items: center; gap: .45rem; min-height: 48px; padding: 0 .5rem; border-radius: 12px; border: 0; background: none; cursor: pointer; font: inherit; color: var(--ink2); text-align: left; }
.dt-case i { font-style: normal; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 8px; background: color-mix(in srgb, var(--strong) 8%, transparent); font-size: .78rem; font-weight: 800; color: var(--dim); }
.dt-case b { font-size: .95rem; font-weight: 800; }
.dt-case.on i { background: var(--gold); color: var(--on-gold); }
.dt-case.on b { color: var(--gold); }
.dt-cell { display: flex; flex-wrap: wrap; align-content: center; gap: .25rem; min-height: 48px; padding: .3rem .4rem; border-radius: 12px; cursor: pointer;
	background: var(--panel); border: 1px solid var(--line); transition: opacity .25s, box-shadow .2s, border-color .2s; }
.dt-cell.empty { cursor: default; background: none; border-style: dashed; }
.dt-cell.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: color-mix(in srgb, var(--gold) 9%, var(--panel)); }
.dt-cell.cross { background: color-mix(in srgb, var(--gold) 4%, var(--panel)); }
.dt-f { display: inline-flex; align-items: center; min-height: 34px; padding: 0 .5rem; border-radius: 9px; border: 0; background: none; cursor: pointer; font: inherit;
	font-family: "Thunder Pali", var(--f-body); font-weight: 800; font-size: 1.08rem; color: var(--strong); white-space: nowrap; }
.dt-f:hover { background: color-mix(in srgb, var(--strong) 8%, transparent); }
.dt-f .stem { color: var(--dim); font-weight: 700; }
.dt-f .end { color: var(--lc); }
.dt-f.same { background: color-mix(in srgb, var(--gold) 24%, transparent); color: var(--strong); box-shadow: 0 0 0 1px var(--gold) inset; }
.dt.spot .dt-f:not(.same) { opacity: .3; }
.dt-tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.dt-out { 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); }
.dt-eq { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-weight: 800; }
.dt-eq b { font-family: "Thunder Pali", var(--f-body); font-size: 1.3rem; color: var(--pali); }
.dt-eq .op { color: var(--dim); }
.dt-eq .mark { padding: 0 .45rem; border-radius: 8px; background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); }
.dt-res { display: flex; flex-wrap: wrap; gap: .3rem .6rem; }
.dt-res b { font-family: "Thunder Pali", var(--f-body); font-size: clamp(1.9rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.3; color: var(--gold); white-space: nowrap; }
.dt-note { margin: 0; padding: .6rem .8rem; border-radius: 12px; background: color-mix(in srgb, var(--gold) 8%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 28%, transparent); color: var(--ink2); font-size: .9rem; font-weight: 600; line-height: 1.6; }
.dupes { display: flex; flex-wrap: wrap; gap: .4rem; }
.dupe { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .25rem .75rem; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font: inherit; color: var(--ink); }
.dupe b { font-family: "Thunder Pali", var(--f-body); font-weight: 800; font-size: 1.08rem; white-space: nowrap; }
.dupe span { display: grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .3rem; border-radius: 8px; background: var(--gold); color: var(--on-gold); font-size: .78rem; font-weight: 800; }
.dupe[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }

/* ════ ด่าน ๙ คลังการ์ด ════ */
.dcard.dk-tab { --kc: var(--lc); }
.dk-sab { --kc: var(--s-purisa); } .dk-nip { --kc: var(--gold); } .dk-up { --kc: var(--l-napung); } .dk-pur { --kc: var(--s-aniyama); }
.dch.w-md { font-size: 2.6rem; } .dch.w-lg { font-size: 2rem; } .dch.w-xl { font-size: 1.55rem; }
.dch-s.w-lg, .dch-s.w-xl { font-size: 1.2rem; white-space: nowrap; }
.dfront .dmean { font-size: .78rem; font-weight: 700; color: var(--dim); }

/* ════ เกม ════ */
.intro-lead { margin: -.3rem 0 .9rem; color: var(--muted); font-weight: 700; }
.qform { color: var(--strong); text-shadow: 0 6px 30px color-mix(in srgb, var(--gold) 26%, transparent); white-space: nowrap; }
.qform.is-long { font-size: clamp(2rem, 7vw, 3.2rem); }
.qbig.pali { cursor: default; }
.qgloss { margin: -.3rem 0 0; color: var(--gloss); font-weight: 700; }
.tone-l-pung { --tc: var(--l-pung); } .tone-l-itthi { --tc: var(--l-itthi); } .tone-l-napung { --tc: var(--l-napung); }
.tone-s-purisa { --tc: var(--s-purisa); } .tone-s-aniyama { --tc: var(--s-aniyama); } .tone-s-niyama { --tc: var(--s-niyama); }
.tone-n-eka, .tone-n-bahu { --tc: var(--gold); }
.ch-two .ctext.pali { font-size: 1.7rem; }
.ch-letters .ctext.pali { font-size: 1.5rem; white-space: nowrap; }
.choice-big .ctext.pali { font-size: 2.2rem; }
.ch-grid .ctext.pali { font-size: 1.35rem; white-space: nowrap; }
.miss-text { grid-template-columns: minmax(0, 1fr); }
.miss-big.is-long { font-size: 1.3rem; }
.qv-kar { display: flex; flex-direction: column; gap: .25rem; }
.qv-krow { display: grid; grid-template-columns: 7rem repeat(6, 2.4rem); gap: .25rem; align-items: center; opacity: .5; }
.qv-krow.on { opacity: 1; }
.qv-kl { font-size: .78rem; font-weight: 800; color: var(--lc); text-align: right; padding-right: .3rem; white-space: nowrap; }
.qv-kc { display: grid; place-items: center; height: 2.2rem; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--lc) 45%, transparent); background: color-mix(in srgb, var(--lc) 12%, transparent); font-weight: 800; color: var(--strong); }
.qv-kc.empty { border-style: dashed; background: none; }
.qv-kc.hi { background: var(--lc); color: var(--on-seal); box-shadow: 0 0 0 2px var(--lc); }
.qv-vib { display: flex; flex-direction: column; gap: .3rem; }
.qv-vrow { display: grid; grid-template-columns: 5.5rem 6rem minmax(0, 1fr); gap: .6rem; align-items: center; padding: .4rem .7rem; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-align: left; }
.qv-vn { font-weight: 800; color: var(--gold); }
.qv-vm { font-weight: 800; color: var(--pali); font-size: 1.1rem; }
.qv-va { font-size: .86rem; font-weight: 700; color: var(--ink2); }
.qv-tabwrap { width: 100%; overflow-x: auto; }
.qv-tab { margin-inline: auto; border-collapse: separate; border-spacing: 3px; font-size: .9rem; }
.qv-tab caption { padding-bottom: .3rem; font-size: .82rem; font-weight: 700; color: var(--muted); }
.qv-tab caption b { font-size: 1.05rem; color: var(--pali); }
.qv-tab th { font-size: .74rem; font-weight: 800; color: var(--dim); padding: .2rem .4rem; text-align: right; white-space: nowrap; }
.qv-tab tr:first-child th { text-align: center; }
.qv-tab td { padding: .25rem .55rem; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); font-weight: 800; color: var(--ink2); white-space: nowrap; text-align: center; }
.qv-tab td.hi { background: color-mix(in srgb, var(--gold) 20%, transparent); border-color: var(--gold); color: var(--strong); }
.qv-dist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; width: 100%; max-width: 30rem; }
.qv-dw { display: flex; flex-direction: column; align-items: center; padding: .35rem; border-radius: 10px; border: 1px solid var(--line); }
.qv-dw b { font-size: 1.25rem; color: var(--pali); }
.qv-dw small { font-size: .72rem; color: var(--dim); font-weight: 700; }
.qv-dw.hi { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }

@media (max-width: 1000px) {
	.nm-board, .dt-board { grid-template-columns: minmax(0, 1fr); }
	.nm-detail, .dt-out { position: static; }
	.nt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.vt-row { grid-template-columns: 2.4rem 5.6rem repeat(2, 4.6rem) minmax(0, 1fr); }
	.vt-karaka { display: none; }
	.sb-board { grid-template-columns: minmax(0, 1fr); }
	.four-9 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.like-groups, .like-groups.guess { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
	.nm-eq { grid-template-columns: minmax(0, 1fr); }
	.nm-eqop { transform: rotate(90deg); padding-block: .1rem; }
	.flow-3, .flow-4 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
	.nm-maps { grid-template-columns: minmax(0, 1fr); }
	.nm-branches { grid-template-columns: minmax(0, 1fr); }
	.nm-wordlist { grid-template-columns: minmax(0, 1fr); }
	.kb-row { grid-template-columns: 4.6rem repeat(var(--nv, 6), minmax(0, 1fr)); gap: .3rem; }
	.kb-lab { padding: .3rem .4rem; }
	.kb-lab b { font-size: .74rem; white-space: normal; line-height: 1.25; }
	.kb-lab span { font-size: .66rem; }
	.kb-cell, .kb-slot { min-height: 4.4rem; border-radius: 10px; }
	.kb-cell .kv { font-size: 1.3rem; }
	.kb-cell .km { font-size: .66rem; }
	.kb-slot { font-size: 0; }
	.vt-row { grid-template-columns: 2rem 4.6rem repeat(2, 3.4rem) minmax(0, 1fr); gap: .35rem; padding: .4rem; }
	.vt-no { width: 1.9rem; height: 1.9rem; font-size: .85rem; }
	.vt-name { font-size: .9rem; }
	.vt-mark { font-size: 1.15rem; min-height: 44px; }
	.vt-ayat { font-size: .78rem; }
	.burut { grid-template-columns: minmax(0, 1fr); }
	.burut-i { flex-direction: row; justify-content: flex-start; gap: .7rem; text-align: left; padding: .6rem .8rem; }
	.ruler { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ruler::before, .ruler-i::before { display: none; }
	.ruler { padding-top: 1.6rem; }
	.nt-grid { grid-template-columns: minmax(0, 1fr); }
	.four-9 { grid-template-columns: minmax(0, 1fr); }
	.like-groups, .like-groups.guess { grid-template-columns: minmax(0, 1fr); }
	.dpick-l { width: 100%; }
	.dt { grid-template-columns: 4.6rem repeat(var(--nn, 2), minmax(0, 1fr)); gap: .25rem; }
	.dt-case { padding: 0 .2rem; gap: .3rem; }
	.dt-case i { display: none; }
	.dt-case b { font-size: .82rem; }
	.dt-f { font-size: .95rem; padding: 0 .3rem; min-height: 30px; }
	.dt-cell { padding: .2rem; min-height: 44px; }
	.dt-wrap { padding: .7rem; }
	.qv-krow { grid-template-columns: 5.2rem repeat(6, minmax(0, 1fr)); }
	.qv-vrow { grid-template-columns: 4.6rem 4.6rem minmax(0, 1fr); gap: .4rem; }
	.ch-grid .ctext.pali { font-size: 1.15rem; }
	.ch-letters .ctext.pali { font-size: 1.2rem; }
}
.nm-node-t { white-space: nowrap; }
.nm-kidline { display: flex; flex-wrap: wrap; gap: .3rem .5rem; margin: 0; font-weight: 800; color: var(--ink2); }
.nm-kidline span { white-space: nowrap; }
.nm-kidline span + span::before { content: "·"; margin-right: .5rem; color: var(--dim); }
button.dt-h { border: 0; background: none; cursor: pointer; min-height: 40px; font: inherit; font-size: .8rem; font-weight: 800; border-radius: 10px; }
button.dt-h:hover { background: color-mix(in srgb, var(--strong) 6%, transparent); }
.like-groups, .like-groups.guess { display: flex; flex-wrap: wrap; }
.like-groups > .likeg { flex: 1 1 300px; }
@media (max-width: 860px) {
	.nm-kdetail, .nm-vdetail { display: flex; flex-direction: column; align-items: stretch; }
	.nm-kdetail .big, .nm-vdetail .big { min-width: 0; }
	.nm-kdetail .hint { display: block; }
}
.mini-link { flex-wrap: wrap; }
.detail .chip-row .pw { white-space: nowrap; }
.detail dd .chip-row { gap: .2rem .5rem; }
@media (max-width: 860px) { .nm-kdetail > *, .nm-vdetail > * { order: 0 !important; } .nm-vdetail .hint { display: block; text-align: left; } }
.ex-table { grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); }
.ex-row { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }
.ex-row > b { grid-row: auto; font-size: 1.6rem; line-height: 1.25; }
.ex-row .ex-a { white-space: nowrap; font-size: .9rem; }
.up-i > b { display: inline-flex; align-items: baseline; gap: .25rem; white-space: nowrap; }
.up-i > b b { font-size: inherit; color: inherit; }
.up-alt { font-family: var(--f-body); font-size: .72rem; font-weight: 700; color: var(--dim); }
