/* ─────────────────────────────────────────────────────────
   หน้า /vocab-bank (ท่องศัพท์ธรรมบท) — ส่วนเฉพาะหน้า
   ฐานธีมห้องฉาย (คราม-ทอง) อยู่ app/css/study-cinema.css · ห้ามแก้ไฟล์นั้นจากหน้านี้
   ขนาดตัวอักษรทุกตัวผูก --reading-scale · ตัวอ่าน ≥ 14px · คำบาลี ≥ 15px
   สี = ความหมาย: บาลี = คราม (ตัวหนา) · คำแปล = เทาอ่อน · ท่องได้แล้ว = เขียว
                  ถึงกำหนดทวน = อำพัน · พื้นฐาน = ทอง · กลาง = คราม
   ───────────────────────────────────────────────────────── */

/* ฐ ญ ในคำบาลีไม่มีเชิง — ฟอนต์ Thunder Pali (Sarabun ที่เปลี่ยนเฉพาะ ฐ ญ) ชุดเดียวกับ lesson.css .pali-nt
   ใช้กับข้อความที่มาจากช่องบาลีของคลังเท่านั้น (w · forms · vatthu · ประโยคบาลี) — คำแปลไทยคงเชิง */
@font-face { font-family: "Thunder Pali"; font-style: normal; font-weight: 400; 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-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/thunder-pali/ThunderPali-500.woff2") format("woff2"); unicode-range: U+0E00-0E7F, U+25CC; }
@font-face { font-family: "Thunder Pali"; font-style: normal; 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-style: normal; 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; }
.vb-pn { font-family: "Thunder Pali", "Sarabun", sans-serif; }

.vb-page {
	--vb-pali: #c7d2fe;      /* คำบาลี */
	--vb-mean: #d6dcec;      /* คำแปล */
	--vb-amber: #fcd34d;     /* ถึงกำหนดทวน */
	--vb-green: #34d399;     /* ท่องได้แล้ว */
	--vb-card: #10183a;
	--vb-card2: #0d1430;
	overflow-x: hidden;
}
.vb-page button { font-family: inherit; }
.vb-page :focus-visible { outline: 3px solid var(--sc-gold); outline-offset: 2px; }

/* ══════════ ป้ายใหญ่ ══════════ */
/* ภาพ: สามเณรน้อยหลับตาท่องศัพท์บนระเบียง (assets/game/vocab-bank/hero.webp · 3:2)
   หน้าเณรอยู่ราว x 63% y 20% — จอกว้างเห็นหน้าเณรทางขวาของคอลัมน์ข้อความ */
.vb-bill .vb-bill-art { object-position: 50% 22%; }
.vb-bill-inner { min-height: clamp(440px, 62vh, 560px); }
.vb-bill .sc-title span { display: block; }
.vb-hero-prog { width: 100%; }
.vb-hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: .75rem; }
.vb-hero-stats div { display: flex; flex-direction: column; padding: .55rem .7rem; border-radius: 10px; background: rgba(var(--ui-tint), .05); border: 1px solid var(--sc-line); }
.vb-hero-stats b { color: var(--ui-strong); font-size: calc(1.25rem * var(--reading-scale, 1)); font-weight: 800; line-height: 1.3; }
.vb-hero-stats span { color: var(--sc-muted); font-size: calc(.875rem * var(--reading-scale, 1)); font-weight: 700; }

.vb-recent { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .5rem; margin-top: .8rem; }
.vb-recent-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .3rem .6rem; min-height: 44px; padding: .55rem .75rem .6rem; border-radius: 10px; border: 1px solid var(--sc-line); background: rgba(var(--ui-tint), .05); color: var(--ui-strong); text-align: left; cursor: pointer; transition: background-color .15s ease; }
.vb-recent-item:hover { background: rgba(var(--ui-tint), .1); }
.vb-recent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: calc(.92rem * var(--reading-scale, 1)); }
.vb-recent-n { color: var(--sc-muted); font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); font-variant-numeric: tabular-nums; }
.vb-recent-item .vb-mini-track { grid-column: 1 / -1; }

.vb-mini-track { display: block; height: 6px; border-radius: 999px; background: rgba(var(--ui-tint), .1); overflow: hidden; }
.vb-mini-track > span { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: linear-gradient(90deg, var(--sc-gold), var(--sc-green)); }

/* ══════════ ชั้นหนังสือ: การ์ดเรื่อง ══════════ */
.vb-shelf { scroll-margin-top: 7.5rem; }
.vb-shelf-head { margin-bottom: 1.3rem; }
.vb-no-search { font-size: calc(1.05rem * var(--reading-scale, 1)); background: linear-gradient(135deg, #b45309, #78350f); }
.vb-search-story { flex: 0 1 340px; }

.vb-story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.vb-skel-story { height: 176px; }
.vb-story { position: relative; display: flex; flex-direction: column; gap: .3rem; min-height: 176px; padding: 1rem 1.1rem 1.05rem; border: 1.5px solid rgba(165, 180, 252, .22); border-radius: 16px; background: linear-gradient(180deg, var(--ui-lpanel, #18223f) 0%, var(--sc-bg2) 100%); color: var(--ui-strong); text-align: left; cursor: pointer; box-shadow: 0 14px 30px -20px rgba(0, 0, 0, .85); transition: transform .3s cubic-bezier(.25, 1, .5, 1), box-shadow .25s ease; }
.vb-story:hover { transform: translateY(-3px); border-color: rgba(165, 180, 252, .55); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .9); }
/* สถานะ = สีกรอบทั้งใบ (หลวงพี่ไม่ชอบแถบขอบซ้าย ๑๐ ต.ค. ๒๕๖๙) */
.vb-story.is-started { border-color: rgba(245, 191, 69, .5); }
.vb-story.is-done { border-color: rgba(52, 211, 153, .55); }
.vb-story.is-last { border-color: var(--sc-gold); box-shadow: 0 0 0 3px rgba(245, 191, 69, .2), 0 18px 40px -20px rgba(245, 191, 69, .5); }
.vb-story-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 26px; }
.vb-story-no { color: var(--sc-gold); font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); }
.vb-flag { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 999px; font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); }
.vb-flag i { font-size: .8em; }
.vb-flag.is-next { background: var(--sc-gold-fill, var(--sc-gold)); color: #3b2600; }
.vb-flag.is-done { background: #059669; color: #fff; }
.vb-story-title { font-size: calc(1.22rem * var(--reading-scale, 1)); font-weight: 800; line-height: 1.35; }
.vb-story-vatthu { color: var(--sc-indigo); font-weight: 700; font-size: calc(.98rem * var(--reading-scale, 1)); line-height: 1.45; overflow-wrap: anywhere; }
.vb-story-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .15rem; color: var(--sc-muted); font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); }
.vb-story-meta i { color: var(--sc-indigo); margin-right: .2rem; font-size: .9em; }
.vb-story-prog { display: flex; flex-direction: column; gap: .35rem; margin-top: auto; padding-top: .55rem; }
.vb-story-prog-n { color: var(--ui-ink2); font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); }

/* ══════════ ช่องค้น ══════════ */
.vb-search { display: flex; align-items: center; gap: .55rem; min-height: 46px; padding: 0 .85rem; border-radius: 12px; border: 1px solid rgba(var(--ui-tint), .14); background: rgba(var(--ui-tint), .06); color: var(--sc-muted); cursor: text; transition: border-color .15s ease, background-color .15s ease; }
.vb-search:focus-within { border-color: var(--sc-gold); background: rgba(var(--ui-tint), .09); }
.vb-search i { flex: none; font-size: calc(.9rem * var(--reading-scale, 1)); }
.vb-search input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; color: var(--ui-strong); font: inherit; font-size: max(16px, calc(1rem * var(--reading-scale, 1))); }
.vb-search input::placeholder { color: var(--ui-muted); }
.vb-search input::-webkit-search-cancel-button { filter: invert(1) brightness(.8); cursor: pointer; }

/* ══════════ หัวเรื่อง (หน้าท่อง) ══════════ */
.sc-bill.vb-bill-story::before {
	background:
		linear-gradient(90deg, rgba(var(--ui-lpanel-rgb, 10, 15, 30), .97) 0%, rgba(var(--ui-lpanel-rgb, 10, 15, 30), .9) 42%, rgba(var(--ui-lpanel-rgb, 10, 15, 30), .55) 100%),
		linear-gradient(0deg, var(--sc-bg) 0%, rgba(var(--ui-lpanel-rgb, 10, 15, 30), 0) 70%);
}
.vb-bill-story .vb-bill-art { object-position: 50% 24%; }
.vb-story-hero, .vb-study { max-width: 78rem; }
.vb-story-hero { padding-top: 1.1rem; padding-bottom: 1.6rem; }
.vb-back { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; padding: 0 1rem 0 .85rem; border-radius: 999px; border: 1px solid rgba(var(--ui-tint), .16); background: rgba(var(--ui-tint), .08); color: var(--ui-strong); font-weight: 800; font-size: calc(.92rem * var(--reading-scale, 1)); cursor: pointer; backdrop-filter: blur(6px); transition: background-color .15s ease; }
.vb-back:hover { background: rgba(var(--ui-tint), .16); }
.vb-back i { color: var(--sc-gold); }
.vb-story-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 430px); align-items: end; gap: 1.2rem 2.5rem; margin-top: 1.2rem; }
.vb-story-h1 { margin: 0; color: var(--ui-strong); font-size: calc(clamp(1.9rem, 3.6vw, 2.8rem) * var(--reading-scale, 1)); font-weight: 800; line-height: 1.3; text-shadow: 0 2px 24px rgba(0, 0, 0, .45); }
.vb-story-h1-vatthu { margin: 0; color: var(--sc-indigo); font-weight: 700; font-size: calc(1.1rem * var(--reading-scale, 1)); }
.vb-story-stat { padding: 1rem 1.1rem; border-radius: 16px; background: rgba(var(--ui-lpanel-rgb, 15, 23, 48), .82); border: 1px solid var(--sc-line); backdrop-filter: blur(8px); }
.vb-story-stat-row { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .6rem; color: var(--sc-muted); font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); }
.vb-story-stat-row b { color: var(--ui-strong); }
.vb-story-stat-row .is-due { color: var(--vb-amber); }
.vb-story-stat-row .is-streak { color: #fdba74; }

/* ══════════ หน้าท่อง: แถบข้าง + รายการ ══════════ */
.vb-study { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: start; gap: 2rem; padding-top: 1.2rem; padding-bottom: 4rem; }

.vb-side { position: sticky; top: calc(4rem + 1rem); display: flex; flex-direction: column; max-height: calc(100vh - 6rem); border-radius: 18px; background: var(--vb-card2); border: 1px solid var(--sc-line); }
.vb-side-scroll { overflow-y: auto; padding: 1rem; scrollbar-width: thin; scrollbar-color: rgba(var(--ui-tint), .15) transparent; }
/* จอกว้างมีแถบข้างอยู่แล้ว — ซ่อนปุ่ม/ส่วนที่ใช้เฉพาะจอเล็ก (ตัวเลือก .vb-page นำหน้า ให้ชนะ .vb-tool/.vb-fc-cta ที่ประกาศทีหลัง) */
.vb-page .vb-sheet-head, .vb-page .vb-sheet-foot, .vb-page .vb-scrim, .vb-page .vb-tool-filter, .vb-page .vb-fc-cta-inline { display: none; }

.vb-fc-cta { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 64px; padding: .7rem .8rem; border: 0; border-radius: 14px; background: linear-gradient(135deg, #f8cf63, #f0a92b); color: #3b2600; text-align: left; cursor: pointer; box-shadow: 0 12px 26px -16px rgba(245, 191, 69, .8); transition: transform .15s ease, filter .15s ease; }
.vb-fc-cta:hover { filter: brightness(1.06); }
.vb-fc-cta:active { transform: scale(.98); }
.vb-fc-cta:disabled { opacity: .4; cursor: not-allowed; }
.vb-fc-cta-ic { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: rgba(59, 38, 0, .14); font-size: calc(1.1rem * var(--reading-scale, 1)); }
.vb-fc-cta-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; line-height: 1.3; }
.vb-fc-cta-copy b { font-size: calc(1.02rem * var(--reading-scale, 1)); font-weight: 800; }
.vb-fc-cta-copy small { font-size: calc(.875rem * var(--reading-scale, 1)); font-weight: 700; color: #5c3d00; }
.vb-fc-due { flex: none; padding: .15rem .55rem; border-radius: 999px; background: #3b2600; color: var(--vb-amber); font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); }

.vb-fgroup { margin-top: 1.25rem; }
.vb-flabel { margin: 0 0 .5rem; color: var(--ui-strong); font-weight: 800; font-size: calc(.95rem * var(--reading-scale, 1)); }
.vb-flabel-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.vb-flabel-row .vb-flabel { margin: 0; }
.vb-fhint { margin: .45rem 0 0; color: var(--sc-muted); font-size: calc(.875rem * var(--reading-scale, 1)); line-height: 1.5; }
.vb-link-btn { display: inline-flex; align-items: center; gap: .4rem; min-height: 36px; padding: 0 .6rem; border: 0; border-radius: 8px; background: transparent; color: var(--sc-gold); font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); cursor: pointer; }
.vb-link-btn:hover { background: rgba(245, 191, 69, .12); }
.vb-clear-all { margin-top: 1.1rem; min-height: 44px; }

/* ปุ่มแบ่งช่อง (ระดับ / เรียง) */
.vb-seg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(var(--ui-tint), .05); border: 1px solid var(--sc-line); }
.vb-seg button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 48px; padding: .3rem .35rem; border: 0; border-radius: 9px; background: transparent; color: var(--ui-ink2); font-weight: 800; font-size: calc(.9rem * var(--reading-scale, 1)); line-height: 1.25; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.vb-seg button i { color: var(--sc-indigo); font-size: .85em; margin-bottom: .15rem; }
.vb-seg button small { color: var(--sc-muted); font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); font-variant-numeric: tabular-nums; }
.vb-seg button:hover { background: rgba(var(--ui-tint), .07); }
.vb-seg button[aria-checked="true"] { background: var(--ui-sel-bg); color: var(--ui-sel-ink); }
.vb-seg button[aria-checked="true"] i { color: #4338ca; }
.vb-seg button[aria-checked="true"] small { color: #4b5576; }

/* รายการตัวเลือก (แสดง) */
.vb-opts { display: flex; flex-direction: column; gap: 4px; }
.vb-opts button { display: flex; align-items: center; gap: .65rem; min-height: 44px; padding: 0 .75rem; border: 1px solid transparent; border-radius: 10px; background: rgba(var(--ui-tint), .04); color: var(--ui-ink2); font-weight: 800; font-size: calc(.92rem * var(--reading-scale, 1)); text-align: left; cursor: pointer; transition: background-color .15s ease; }
.vb-opts button:hover { background: rgba(var(--ui-tint), .08); }
.vb-opts button span { flex: 1; }
.vb-opts button small { color: var(--sc-muted); font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); font-variant-numeric: tabular-nums; }
.vb-opts button i { width: 1.1em; text-align: center; color: var(--sc-dim); }
.vb-opts .is-known i { color: var(--vb-green); }
.vb-opts .is-due i { color: var(--vb-amber); }
.vb-opts .is-all i { color: var(--sc-indigo); }
.vb-opts button[aria-checked="true"] { background: rgba(245, 191, 69, .12); border-color: rgba(245, 191, 69, .55); color: var(--ui-strong); }
.vb-opts button[aria-checked="true"] small { color: var(--ui-gold-ink); }

/* ช่วงหน้า: สไลเดอร์คู่บนรางเดียว (ลากไขว้กันแล้วดันอีกฝั่งตาม — กติกาเดิมของ setPage) */
.vb-range-now { margin: 0 0 .1rem; color: var(--ui-ink2); font-weight: 700; font-size: calc(.92rem * var(--reading-scale, 1)); }
.vb-range-now b { color: var(--ui-strong); font-variant-numeric: tabular-nums; }
.vb-range-now span { margin-left: .35em; color: var(--sc-muted); }
.vb-range-now .is-narrow { color: var(--vb-green); }
.vb-range { position: relative; height: 44px; }
.vb-range-track { position: absolute; left: 13px; right: 13px; top: 50%; height: 6px; margin-top: -3px; border-radius: 999px; background: rgba(var(--ui-tint), .12); }
.vb-range-track span { position: absolute; top: 0; bottom: 0; border-radius: inherit; background: linear-gradient(90deg, var(--sc-gold), var(--sc-green)); }
.vb-range input { position: absolute; inset: 0; width: 100%; height: 44px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.vb-range input:last-of-type { z-index: 1; }
.vb-range input.is-top { z-index: 2; }   /* ไม้เริ่มชิดขวา = ยกขึ้นบนสุด ไม่งั้นถูกไม้จบทับจนลากไม่ได้ */
.vb-range input::-webkit-slider-runnable-track { height: 44px; background: transparent; }
.vb-range input::-moz-range-track { height: 44px; background: transparent; }
.vb-range input::-webkit-slider-thumb { pointer-events: auto; width: 26px; height: 26px; margin-top: 9px; border-radius: 50%; background: #fff; border: 4px solid var(--sc-gold); box-shadow: 0 2px 8px rgba(0, 0, 0, .5); cursor: grab; -webkit-appearance: none; appearance: none; }
.vb-range input::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--sc-gold); box-shadow: 0 2px 8px rgba(0, 0, 0, .5); cursor: grab; }
.vb-range input:focus-visible { outline: none; }
.vb-range input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(245, 191, 69, .45); }
.vb-range-ends { display: flex; justify-content: space-between; padding: 0 4px; color: var(--sc-dim); font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); }

/* แถบเครื่องมือติดหัว */
.vb-bar { position: sticky; top: 4rem; z-index: 20; display: flex; align-items: center; gap: .5rem; margin: 0 -.6rem; padding: .7rem .6rem; background: var(--ui-scrim); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.vb-bar .vb-search { flex: 1; min-width: 0; }
.vb-tool { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; flex: none; min-height: 46px; padding: 0 1rem; border-radius: 12px; border: 1px solid rgba(var(--ui-tint), .16); background: rgba(var(--ui-tint), .07); color: var(--ui-strong); font-weight: 800; font-size: calc(.92rem * var(--reading-scale, 1)); white-space: nowrap; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.vb-tool:hover { background: rgba(var(--ui-tint), .13); }
.vb-tool i { color: var(--sc-gold); }
.vb-tool-recite.is-on { background: var(--sc-gold-fill, var(--sc-gold)); border-color: var(--sc-gold); color: #3b2600; }
.vb-tool-recite.is-on i { color: #3b2600; }
.vb-switch { position: relative; width: 34px; height: 20px; flex: none; border-radius: 999px; background: rgba(var(--ui-tint), .22); transition: background-color .2s ease; }
.vb-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.vb-tool-recite.is-on .vb-switch { background: #3b2600; }
.vb-tool-recite.is-on .vb-switch::after { transform: translateX(14px); background: var(--sc-gold-fill, var(--sc-gold)); }
.vb-badge { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 .3rem; border-radius: 999px; background: var(--sc-gold-fill, var(--sc-gold)); color: #3b2600; font-size: calc(.875rem * var(--reading-scale, 1)); font-weight: 800; }

.vb-listhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: .4rem 0 .9rem; }
.vb-count { margin: 0; color: var(--sc-muted); font-weight: 700; font-size: calc(.95rem * var(--reading-scale, 1)); }
.vb-count b { color: var(--ui-strong); font-size: calc(1.15rem * var(--reading-scale, 1)); }
.vb-count-hint { margin-left: .6rem; color: var(--sc-gold); }
.vb-active { display: flex; flex-wrap: wrap; gap: .4rem; }
.vb-active-chip { display: inline-flex; align-items: center; gap: .45rem; min-height: 36px; padding: 0 .75rem; border-radius: 999px; border: 1px solid rgba(165, 180, 252, .35); background: rgba(99, 102, 241, .14); color: var(--ui-ink2); font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); cursor: pointer; }
.vb-active-chip i { color: var(--sc-muted); font-size: .85em; }
.vb-active-chip:hover { background: rgba(99, 102, 241, .26); }

/* ══════════ การ์ดคำ (คำละใบ) ══════════ */
.vb-list { display: flex; flex-direction: column; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.vb-skel-word { height: 118px; }
.vb-word { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .9rem; padding: 1rem 1rem 1rem 1.15rem; border-radius: 16px; background: var(--vb-card); border: 1px solid rgba(var(--ui-tint), .07); content-visibility: auto; contain-intrinsic-size: auto 130px; transition: border-color .2s ease, background-color .2s ease; }
/* ท่องได้แล้ว = กรอบเขียวทั้งใบ + พื้นเขียวจาง (ไม่ใช้แถบขอบซ้าย — หลวงพี่ไม่ชอบ) */
.vb-word.is-known { background: linear-gradient(180deg, rgba(52, 211, 153, .09), rgba(52, 211, 153, .02) 60%, var(--vb-card) 100%); border-color: rgba(52, 211, 153, .5); }
.vb-word-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: .45rem; min-width: 0; }
.vb-word-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; min-width: 0; }
.vb-pali { margin: 0; color: var(--vb-pali); font-size: calc(1.55rem * var(--reading-scale, 1)); font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.vb-tier { display: inline-flex; align-items: center; padding: 0 .5rem; border-radius: 6px; border: 1px solid; font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); line-height: 1.6; }
.vb-tier.is-t1 { color: var(--sc-gold); border-color: rgba(245, 191, 69, .45); background: rgba(245, 191, 69, .08); }
.vb-tier.is-t2 { color: var(--sc-indigo); border-color: rgba(165, 180, 252, .4); background: rgba(165, 180, 252, .08); }

.vb-mean-box { position: relative; border-radius: 10px; }
.vb-mean { margin: 0; color: var(--vb-mean); font-size: calc(1.1rem * var(--reading-scale, 1)); font-weight: 500; line-height: 1.6; }
.vb-dict { margin: .15rem 0 0; color: var(--ui-muted); font-size: calc(.92rem * var(--reading-scale, 1)); line-height: 1.55; }
.vb-dict span { display: inline-block; margin-right: .35rem; padding: 0 .4rem; border-radius: 5px; background: rgba(var(--ui-tint), .07); color: var(--sc-muted); font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); }
.vb-ms { display: inline-flex; align-items: center; gap: .3rem; margin-left: .3rem; padding: .05rem .55rem; border-radius: 999px; font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); line-height: 1.6; vertical-align: .1em; }
.vb-ms.is-yok { background: rgba(52, 211, 153, .14); color: var(--ui-green); }
.vb-ms.is-checked { background: rgba(165, 180, 252, .16); color: var(--ui-indigo); }
.vb-ms.is-dict { background: rgba(148, 163, 184, .18); color: var(--ui-ink2); }
.vb-ms.is-pending { background: rgba(252, 211, 77, .16); color: var(--vb-amber); }

/* โหมดท่อง: คำแปลเบลอ แตะทีละคำเพื่อเฉลย */
.vb-mean-inner { transition: filter .2s ease, opacity .2s ease; }
.is-recite .vb-mean-box { min-height: 48px; padding: .25rem .55rem; margin-left: -.55rem; cursor: pointer; border: 1px dashed rgba(245, 191, 69, .35); background: rgba(245, 191, 69, .04); }
.is-recite .vb-mean-box:hover { background: rgba(245, 191, 69, .08); }
.is-recite .vb-mean-box:not(.is-shown) .vb-mean-inner { filter: blur(8px); opacity: .45; user-select: none; pointer-events: none; }
.is-recite .vb-mean-box.is-shown { border-style: solid; border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .05); }
.vb-veil { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .45rem; color: var(--sc-gold); font-weight: 800; font-size: calc(.92rem * var(--reading-scale, 1)); pointer-events: none; }

.vb-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.vb-tag { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .6rem; border-radius: 999px; background: rgba(var(--ui-tint), .06); color: var(--ui-ink2); font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); line-height: 1.6; }
.vb-tag i { font-size: .82em; }
.vb-tag.is-c { background: rgba(99, 102, 241, .16); color: var(--ui-indigo); }
.vb-tag.is-vibh { background: rgba(245, 158, 11, .14); color: var(--ui-gold-ink); }
.vb-tag.is-due { background: rgba(252, 211, 77, .16); color: var(--vb-amber); }
.vb-tag.is-later { background: rgba(52, 211, 153, .12); color: var(--ui-green); }
.vb-more-btn { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .8rem; margin-left: auto; border: 0; border-radius: 999px; background: transparent; color: var(--sc-indigo); font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); cursor: pointer; }
.vb-more-btn:hover { background: rgba(165, 180, 252, .1); }
.vb-more-btn .vb-chev { font-size: .75em; transition: transform .2s ease; }
.vb-more-btn[aria-expanded="true"] .vb-chev { transform: rotate(180deg); }

.vb-detail { padding: .85rem 1rem .6rem; border-radius: 12px; background: rgba(var(--ui-tint), .035); border: 1px solid rgba(245, 191, 69, .28); animation: vbIn .2s ease both; }
@keyframes vbIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.vb-detail-label { margin: .2rem 0 .3rem; color: var(--sc-gold); font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); }
.vb-detail-label ~ .vb-detail-label { margin-top: .85rem; }
.vb-sent { margin: 0; color: #e3e8f7; font-size: calc(1.04rem * var(--reading-scale, 1)); line-height: 1.95; }
.vb-sent mark { padding: 0 .2em; border-radius: 4px; background: rgba(245, 191, 69, .22); color: #ffe39a; font-weight: 800; }
.vb-sent-th { margin: .35rem 0 0; color: var(--sc-muted); font-size: calc(.95rem * var(--reading-scale, 1)); line-height: 1.8; }
.vb-forms { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; }
.vb-form { padding: .05rem .55rem; border-radius: 7px; background: rgba(165, 180, 252, .1); color: var(--vb-pali); font-weight: 700; font-size: calc(1rem * var(--reading-scale, 1)); line-height: 1.7; }
.vb-word-link { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; margin-top: .2rem; color: var(--sc-gold); font-weight: 800; font-size: calc(.9rem * var(--reading-scale, 1)); text-decoration: none; }
.vb-word-link:hover { text-decoration: underline; }
.vb-word-link i { font-size: .75em; }

/* ปุ่มติ๊ก "ท่องได้" — checkbox จริงซ้อนทับกล่อง (คีย์บอร์ด/โปรแกรมอ่านจอใช้ได้ตามปกติ) */
.vb-known { position: relative; display: flex; flex-direction: column; align-items: center; gap: .2rem; min-width: 56px; cursor: pointer; user-select: none; }
.vb-known input { position: absolute; top: 0; left: 50%; width: 46px; height: 46px; margin: 0 0 0 -23px; opacity: 0; cursor: pointer; }
.vb-known-box { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; border: 2px solid rgba(var(--ui-tint), .22); background: rgba(var(--ui-tint), .03); color: transparent; font-size: calc(1.1rem * var(--reading-scale, 1)); transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }
.vb-known:hover .vb-known-box { border-color: rgba(52, 211, 153, .7); color: rgba(52, 211, 153, .45); }
.vb-known input:checked + .vb-known-box { background: var(--vb-green); border-color: var(--vb-green); color: #052e1f; transform: scale(1.04); }
.vb-known input:focus-visible + .vb-known-box { outline: 3px solid var(--sc-gold); outline-offset: 2px; }
.vb-known-t { color: var(--sc-dim); font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); }
.vb-known input:checked ~ .vb-known-t { color: var(--vb-green); }

.vb-more { display: flex; justify-content: center; padding: 1.5rem 0 .5rem; }
.vb-end { margin: 1.6rem 0 0; text-align: center; color: var(--sc-dim); font-weight: 700; font-size: calc(.9rem * var(--reading-scale, 1)); }
.vb-empty { display: flex; flex-direction: column; align-items: center; gap: .8rem; padding: 3.5rem 1rem; text-align: center; color: var(--sc-muted); }
.vb-empty i { color: rgba(165, 180, 252, .5); font-size: calc(2rem * var(--reading-scale, 1)); }
.vb-empty p { margin: 0; font-weight: 700; font-size: calc(1.02rem * var(--reading-scale, 1)); }
.vb-empty .sc-actions { justify-content: center; }

.vb-icon-btn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(var(--ui-tint), .1); color: var(--ui-strong); font-size: calc(1.05rem * var(--reading-scale, 1)); cursor: pointer; }
.vb-icon-btn:hover { background: rgba(var(--ui-tint), .2); }

/* จอกว้าง: บาลีซ้าย · คำแปลขวา อ่านไล่ลงเป็นบัญชีศัพท์ */
@media (min-width: 720px) {
	.vb-word-body { grid-template-columns: minmax(0, 32%) minmax(0, 1fr); column-gap: 1.4rem; }
	.vb-word-head { grid-row: 1 / span 2; flex-direction: column; align-items: flex-start; }
	.vb-mean-box, .vb-tags { grid-column: 2; }
	.vb-detail { grid-column: 1 / -1; }
}

/* ══════════ จอกลาง/เล็ก: ตัวกรองเป็นแผ่นเลื่อนขึ้นจากล่าง ══════════ */
@media (max-width: 1023px) {
	.vb-study { display: block; padding-top: .4rem; }
	.vb-page .vb-tool-filter { display: inline-flex; }
	.vb-page .vb-fc-cta-inline { display: flex; margin-bottom: 1rem; }
	.vb-side .vb-fc-cta { display: none; }
	.vb-side .vb-fgroup:first-of-type { margin-top: .2rem; }
	.vb-page .vb-scrim { display: block; position: fixed; inset: 0; z-index: 69; background: rgba(var(--ui-lpanel-rgb, 3, 6, 16), .62); backdrop-filter: blur(2px); animation: vbFade .2s ease both; }
	@keyframes vbFade { from { opacity: 0; } to { opacity: 1; } }
	.vb-side { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 70; max-height: min(86vh, 720px); max-width: 560px; margin: 0 auto; border-radius: 22px 22px 0 0; border-bottom: 0; background: var(--ui-panel); box-shadow: 0 -24px 60px -20px rgba(0, 0, 0, .8); transform: translateY(105%); visibility: hidden; transition: transform .3s cubic-bezier(.25, 1, .5, 1), visibility 0s linear .3s; }
	.vb-side.is-open { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.25, 1, .5, 1), visibility 0s; }
	.vb-page .vb-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: .7rem .8rem .2rem 1.1rem; }
	.vb-sheet-head b { color: var(--ui-strong); font-size: calc(1.1rem * var(--reading-scale, 1)); }
	.vb-sheet-head::before { content: ""; position: absolute; left: 50%; top: 7px; width: 40px; height: 4px; margin-left: -20px; border-radius: 999px; background: rgba(var(--ui-tint), .2); }
	.vb-page .vb-sheet-foot { display: block; padding: .7rem 1rem calc(.8rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--sc-line); }
	.vb-sheet-foot .sc-btn { width: 100%; min-height: 50px; justify-content: center; }
	.vb-story-hero-grid { grid-template-columns: minmax(0, 1fr); }
	.vb-story-stat { max-width: 560px; }
}

@media (max-width: 640px) {
	/* ป้ายใหญ่หน้าคลัง: ภาพเป็นแถบสูง 300px บนสุด (กติกา .sc-bill-art ของธีม) แล้วไล่สีลงพื้นเข้ม
	   เลื่อนภาพไปทางขวาให้หน้าเณรอยู่กลางจอ 390px */
	.vb-bill .vb-bill-art { object-position: 96% 30%; }
	.vb-bill-inner { min-height: 0; }
	.vb-bill .sc-title span { display: inline; }
	.vb-hero-stats b { font-size: calc(1.1rem * var(--reading-scale, 1)); }
	.vb-recent { grid-template-columns: minmax(0, 1fr); }
	.vb-shelf-head .min-w-0 { flex-basis: calc(100% - 64px); }
	.vb-search-story { flex: 1 1 100%; }
	.vb-story-grid { grid-template-columns: minmax(0, 1fr); gap: .65rem; }
	.vb-story { min-height: 0; padding: .85rem 1rem .9rem 1.05rem; }
	.vb-story-title { font-size: calc(1.12rem * var(--reading-scale, 1)); }

	/* หน้าท่อง: หัวเรื่องกะทัดรัด ไม่ต้องมีแถบภาพ */
	.vb-bill-story .vb-bill-art { top: 0; bottom: 0; height: 100%; opacity: .45; object-position: 92% 22%; }
	.sc-bill.vb-bill-story::before { background: linear-gradient(180deg, rgba(var(--ui-lpanel-rgb, 10, 15, 30), .82) 0%, rgba(var(--ui-lpanel-rgb, 10, 15, 30), .9) 60%, var(--sc-bg) 100%); }
	.vb-story-hero { padding-top: .8rem; padding-bottom: 1rem; }
	.vb-story-hero-grid { margin-top: .8rem; gap: .9rem; }
	.vb-story-h1 { font-size: calc(1.7rem * var(--reading-scale, 1)); }
	.vb-story-stat { padding: .8rem .9rem; }

	.vb-bar { margin: 0 -1rem; padding: .55rem 1rem; gap: .4rem; border-bottom: 1px solid var(--sc-line); }
	.vb-tool { padding: 0 .75rem; }
	.vb-tool-filter span { display: none; }
	.vb-tool-filter { width: 46px; padding: 0; }
	.vb-tool-filter .vb-badge { position: absolute; top: -6px; right: -6px; }
	.vb-tool-recite .vb-switch { display: none; }
	.vb-listhead { margin-top: .7rem; }
	.vb-count-hint { display: block; margin: .15rem 0 0; }

	.vb-word { gap: .6rem; padding: .85rem .75rem .85rem .95rem; }
	.vb-pali { font-size: calc(1.4rem * var(--reading-scale, 1)); }
	.vb-mean { font-size: calc(1.05rem * var(--reading-scale, 1)); }
	.vb-known { min-width: 48px; }
	.vb-detail { padding: .75rem .8rem .5rem; }
}

/* ══════════════ โหมดแฟลชการ์ด ══════════════ */
.fc-wrap { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; overflow: hidden; color: var(--ui-strong); background: radial-gradient(120% 80% at 50% 0%, #1d2b63 0%, var(--ui-lpanel, #0f1730) 48%, var(--ui-lpanel, #0a0f1e) 100%); }
.fc-col { width: 100%; max-width: 34rem; margin: 0 auto; }
.fc-top { flex: none; padding: 1rem 1rem .5rem; }
.fc-top-row { display: flex; align-items: center; gap: .75rem; }
.fc-top-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; line-height: 1.35; }
.fc-top-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(1rem * var(--reading-scale, 1)); }
.fc-top-copy span { color: var(--sc-indigo); font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); }
.fc-streak { flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: 999px; background: rgba(245, 191, 69, .16); color: var(--ui-gold-ink); font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); }
.fc-track { margin-top: .75rem; }
.fc-scroll { flex: 1; overflow-y: auto; padding: .4rem 1rem 2rem; }

.fc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: .5rem; text-align: center; }
.fc-stats div { display: flex; flex-direction: column; justify-content: center; padding: .8rem .4rem; border-radius: 16px; background: rgba(var(--ui-tint), .07); border: 1px solid var(--sc-line); }
.fc-stats b { font-size: calc(1.6rem * var(--reading-scale, 1)); font-weight: 800; line-height: 1.25; }
.fc-stats span { color: var(--ui-ink2); font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); line-height: 1.35; }
.fc-wrap .is-due { color: var(--vb-amber); }
.fc-wrap .is-ok { color: var(--ui-green); }
.fc-wrap .is-bad { color: var(--ui-rose); }
.fc-label { margin: 1.2rem 0 .5rem; color: var(--ui-indigo); font-weight: 800; font-size: calc(.92rem * var(--reading-scale, 1)); }
.fc-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.fc-pills-2, .fc-pills-3 { display: grid; }
.fc-pills-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fc-pills-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fc-pills button { min-height: 48px; padding: 0 1rem; border: 0; border-radius: 12px; background: rgba(var(--ui-tint), .09); color: var(--ui-strong); font-weight: 800; font-size: calc(.95rem * var(--reading-scale, 1)); cursor: pointer; transition: background-color .15s ease; }
.fc-pills-3 button { padding: 0 .4rem; }
.fc-pills button:hover { background: rgba(var(--ui-tint), .17); }
.fc-pills button[aria-pressed="true"] { background: var(--sc-gold-fill, var(--sc-gold)); color: #3b2600; }
.fc-go { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; min-height: 56px; margin-top: 1.5rem; border: 0; border-radius: 16px; background: var(--sc-gold-fill, var(--sc-gold)); color: #3b2600; font-weight: 800; font-size: calc(1.1rem * var(--reading-scale, 1)); cursor: pointer; box-shadow: 0 14px 30px -18px rgba(245, 191, 69, .9); transition: filter .15s ease, transform .15s ease; }
.fc-go:hover { filter: brightness(1.06); }
.fc-go:active { transform: scale(.98); }
.fc-go:disabled { opacity: .4; cursor: not-allowed; }
.fc-go.is-white { background: #fff; color: #1e1b4b; box-shadow: none; margin-top: 0; }
.fc-note { margin-top: 1.4rem; padding: 1rem 1.1rem; border-radius: 16px; background: rgba(var(--ui-tint), .04); border: 1px solid var(--sc-line); color: var(--ui-muted); font-size: calc(.92rem * var(--reading-scale, 1)); line-height: 1.7; }
.fc-note p { margin: 0; }
.fc-note p + p { margin-top: .55rem; }
.fc-note .fc-note-h { color: var(--ui-strong); font-weight: 800; }

/* การ์ด */
.fc-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 1rem 1rem; }
.fc-stage-mid { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.fc-scene { width: 100%; max-width: 34rem; height: min(62vh, 540px); perspective: 1400px; }
.fc-card { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2, .75, .2, 1); }
.fc-card.is-flipped { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; background: #fffdf7; color: #1e1b4b; cursor: pointer; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .75); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fc-back { transform: rotateY(180deg); cursor: default; }
.fc-edge { flex: none; height: 6px; background: linear-gradient(90deg, #4338ca, #818cf8 55%, var(--sc-gold)); }
.fc-edge.is-done { background: linear-gradient(90deg, #059669, #34d399 55%, var(--sc-gold)); }
.fc-face-top { flex: none; display: flex; align-items: center; justify-content: space-between; padding: .7rem 1.1rem 0; color: var(--ui-muted); font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); }
.fc-face-top .is-q { color: #4f46e5; }
.fc-face-top .is-a { color: #059669; }
.fc-face-body { flex: 1; min-height: 0; display: flex; overflow-y: auto; padding: .75rem 1.25rem; }
.fc-face-center { width: 100%; margin: auto; text-align: center; }
.fc-word { color: #312e81; font-size: calc(clamp(2rem, 9vw, 3.3rem) * var(--reading-scale, 1)); font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.fc-word.is-sm { font-size: calc(clamp(1.5rem, 6.5vw, 2.2rem) * var(--reading-scale, 1)); }
.fc-mean { color: #1f2937; font-size: calc(clamp(1.3rem, 5.5vw, 1.9rem) * var(--reading-scale, 1)); font-weight: 700; line-height: 1.5; }
.fc-mean.is-ans { margin-top: .35rem; color: #047857; }
.fc-sub { margin-top: .5rem; color: #64748b; font-size: calc(.92rem * var(--reading-scale, 1)); }
.fc-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: .75rem; }
.fc-face .vb-tag { background: #f1f5f9; color: #475569; }
.fc-face .vb-tag.is-c { background: #eef2ff; color: #4338ca; }
.fc-face .vb-tag.is-vibh { background: #fffbeb; color: #b45309; }
.fc-face .vb-tag.is-later { background: #ecfdf5; color: #047857; }
.fc-face .vb-ms { margin-left: 0; }
.fc-face .vb-ms.is-yok { background: #ecfdf5; color: #047857; }
.fc-face .vb-ms.is-checked { background: #eef2ff; color: #4338ca; }
.fc-face .vb-ms.is-dict { background: #f1f5f9; color: #475569; }
.fc-face .vb-ms.is-pending { background: #fef3c7; color: #92400e; }
.fc-dict { margin-top: .5rem; color: #64748b; }
.fc-dict span { background: #f1f5f9; color: #64748b; }
.fc-sentbox { margin-top: 1rem; padding: .65rem .85rem; border-radius: 12px; background: #f1f5f9; text-align: left; cursor: pointer; }
.fc-face .vb-sent { color: #1f2937; font-size: calc(1rem * var(--reading-scale, 1)); }
.fc-face .vb-sent mark { background: #fde68a; color: #78350f; }
.fc-face .vb-sent-th { color: #64748b; }
.fc-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.fc-more { margin: .35rem 0 0; color: #4f46e5; font-weight: 800; font-size: calc(.875rem * var(--reading-scale, 1)); }
.fc-textbtn { display: inline-flex; align-items: center; min-height: 44px; margin-top: .4rem; padding: 0 .4rem; border: 0; background: none; color: #4f46e5; font-weight: 800; font-size: calc(.92rem * var(--reading-scale, 1)); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.fc-face-foot { flex: none; padding: 0 1rem .85rem; text-align: center; color: var(--ui-muted); font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); }
.fc-in { animation: fcIn .3s ease both; }
@keyframes fcIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }

.fc-actions { flex: none; margin-top: .8rem; }
.fc-grades { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.fc-grade { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 62px; padding: .5rem .3rem; border: 0; border-radius: 16px; color: var(--ui-strong); font-weight: 800; font-size: calc(1.05rem * var(--reading-scale, 1)); cursor: pointer; box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .7); transition: filter .15s ease, transform .15s ease; }
.fc-grade:hover { filter: brightness(1.08); }
.fc-grade:active { transform: scale(.97); }
.fc-grade small { font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); opacity: .85; }
.fc-grade.is-again { background: #e11d48; }
.fc-grade.is-hard { background: var(--sc-gold-fill, var(--sc-gold)); color: #3b2600; }
.fc-grade.is-good { background: #059669; }
.fc-reveal { width: 100%; min-height: 58px; border: 0; border-radius: 16px; background: rgba(var(--ui-tint), .14); color: var(--ui-strong); font-weight: 800; font-size: calc(1.1rem * var(--reading-scale, 1)); cursor: pointer; }
.fc-reveal:hover { background: rgba(var(--ui-tint), .22); }
.fc-reveal small { color: var(--sc-indigo); font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); }
.fc-tip { margin: .55rem 0 0; text-align: center; color: var(--ui-indigo); font-size: calc(.875rem * var(--reading-scale, 1)); }

/* สรุปรอบ */
.fc-done { text-align: center; }
.fc-ring { display: grid; place-items: center; width: 8.5rem; height: 8.5rem; margin: .5rem auto 0; border-radius: 50%; }
.fc-ring > div { display: grid; place-content: center; width: 6.5rem; height: 6.5rem; border-radius: 50%; background: var(--ui-panel); }
.fc-ring b { font-size: calc(1.9rem * var(--reading-scale, 1)); font-weight: 800; line-height: 1.2; }
.fc-ring span { color: var(--sc-indigo); font-weight: 700; font-size: calc(.875rem * var(--reading-scale, 1)); }
.fc-done h3 { margin: 1rem 0 0; font-size: calc(1.4rem * var(--reading-scale, 1)); font-weight: 800; }
.fc-done-sub { margin: .3rem 0 0; color: var(--ui-ink2); font-size: calc(.95rem * var(--reading-scale, 1)); }
.fc-done .fc-stats { margin-top: 1.1rem; }
.fc-done-actions { display: flex; flex-direction: column; gap: .55rem; margin-top: 1.3rem; }
.fc-done-actions .fc-go { margin-top: 0; }
.fc-review { margin-top: 1.5rem; text-align: left; }
.fc-review .fc-label { margin-top: 0; }
.fc-review-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; margin-top: .4rem; padding: .6rem .9rem; border-radius: 12px; background: rgba(var(--ui-tint), .08); }
.fc-review-row.is-good { background: rgba(var(--ui-tint), .04); }
.fc-review-row b { color: var(--vb-pali); font-size: calc(1.1rem * var(--reading-scale, 1)); }
.fc-review-row span { color: var(--ui-ink2); font-size: calc(.95rem * var(--reading-scale, 1)); }

.fc-burst { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.fc-burst span { position: absolute; top: -24px; width: 9px; height: 14px; border-radius: 2px; animation-name: fcFall; animation-timing-function: linear; animation-fill-mode: both; }
@keyframes fcFall { to { transform: translateY(108vh) rotate(560deg); opacity: .15; } }

@media (prefers-reduced-motion: reduce) {
	.vb-story, .vb-word, .fc-card, .vb-side, .vb-detail, .fc-in { transition: none !important; animation: none !important; }
}

/* ══════════════ โหมดสว่าง (ทั้งเว็บ · ค่าตั้งต้น) ══════════════
   ส่วนทั่วไปใช้โทเคน --ui-* แล้ว · ที่นี่สลับสีประจำหน้า (--vb-*) และพื้นเข้มที่เขียนเป็นไล่สี
   แฟลชการ์ด (.fc-wrap.ui-dark) มืดเสมอเหมือนหน้าจอเกม */
html[data-ui="light"] .vb-page {
	--vb-pali: #312e81;
	--vb-mean: #475467;
	--vb-amber: #b45309;
	--vb-green: #047857;
	--vb-card: #ffffff;
	--vb-card2: #f7f8fc;
}
html[data-ui="light"] .vb-page .fc-wrap { --vb-pali: #c7d2fe; --vb-mean: #d6dcec; --vb-amber: #fcd34d; --vb-green: #34d399; --vb-card: #10183a; --vb-card2: #0d1430; }
html[data-ui="light"] .vb-story { border-color: rgba(79, 70, 229, .22); background: #fff; box-shadow: 0 10px 24px -18px rgba(20, 26, 51, .35); }
html[data-ui="light"] .vb-story:hover { border-color: rgba(79, 70, 229, .5); box-shadow: 0 16px 34px -18px rgba(20, 26, 51, .4); }
html[data-ui="light"] .vb-story.is-started { border-color: rgba(180, 83, 9, .45); }
html[data-ui="light"] .vb-story-h1 { text-shadow: none; }
html[data-ui="light"] .vb-story-stat { background: rgba(255, 255, 255, .9); box-shadow: 0 10px 24px -18px rgba(20, 26, 51, .35); }
@media (max-width: 640px) {
	html[data-ui="light"] .sc-bill.vb-bill-story::before { background: linear-gradient(180deg, rgba(245, 247, 252, .86) 0%, rgba(245, 247, 252, .93) 60%, var(--sc-bg) 100%); }
}
html[data-ui="light"] .vb-seg button[aria-checked="true"] i { color: #c7d2fe; }
html[data-ui="light"] .vb-seg button[aria-checked="true"] small { color: #c7d2fe; }
html[data-ui="light"] .vb-opts button[aria-checked="true"] { background: rgba(245, 191, 69, .16); border-color: rgba(180, 83, 9, .5); }

/* โหมดสว่าง: ไอคอนหมวดค้นคำพื้นสีอ่อน */
html[data-ui="light"] .vb-no-search { background: #fff7e6; color: #92400e; box-shadow: inset 0 0 0 1.5px rgba(217, 119, 6, .4); }
