/* กิริยาธาตุน้ำดี (/dhatu-lab) — สไตล์ทั้งเกมอยู่ไฟล์นี้ไฟล์เดียว (ไม่พึ่ง pp-* ของเกมต้นแบบแล้ว)
   สีสถานี = สีขวดกลั่นห้าใบในฉาก assets/game/dhatu-lab/scene-dhatu.jpg */
@font-face {
	font-family: "THSarabunPaliCut";
	src: url("/assets/fonts/thsarabun/THSarabunPaliCut.ttf?v=20260823.1") format("truetype");  /* ฐ ญ ตัดเชิง (หลวงพี่สั่ง ๑๐ ต.ค. ๒๕๖๙) */
	font-display: swap;
}
[v-cloak] { display: none !important; }
:root {
	--pd-ink: #2a1d10; --pd-muted: #6b5a45; --pd-paper: #fffaf0; --pd-paper2: #f8ecd2;
	--pd-brass: #c8973a; --pd-brass-dark: #8a5a1c; --pd-wood: #6b3f17; --pd-glass: rgba(255, 251, 242, .95);
	--k-prefix: #0f766e; --k-prefix-bg: #ccfbf1; --k-agama: #475569; --k-agama-bg: #f1f5f9;
	--k-dhatu: #92400e; --k-dhatu-bg: #fef3c7; --k-vacaka: #0369a1; --k-vacaka-bg: #e0f2fe;
	--k-kita: #be123c; --k-kita-bg: #ffe4e6; --k-fem: #db2777; --k-fem-bg: #fdf2f8; --k-vib: #6d28d9; --k-vib-bg: #ede9fe;
}
*, *::before, *::after { box-sizing: border-box; }
.pd-body { margin: 0; overflow: hidden; background: #2a1a0b; color: var(--pd-ink); font-family: "Sarabun", sans-serif; }
.pd-app { position: relative; height: 100dvh; min-height: min(360px, 100dvh); display: flex; flex-direction: column; }
.pd-app button, .pd-app a { font-family: inherit; }
.pd-app :focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
.pd-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.pd-scene { position: absolute; inset: 0; background: url(/assets/game/dhatu-lab/scene-dhatu.jpg) center 62% / cover no-repeat; }
.pd-scene::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 38%, rgba(255, 244, 214, .08), rgba(40, 24, 8, .38) 78%); }
/* TH Sarabun x-height 0.34em เล็กกว่า Sarabun (~0.52) — font-size-adjust ให้บาลีสูงเท่าตัวไทยรอบข้าง ไม่ต้องเดาตัวคูณ */
.pd-pali { font-family: "THSarabunPaliCut", "Sarabun", sans-serif; font-size-adjust: 0.53; line-height: 1.3; letter-spacing: 0; }
.pd-muted { color: var(--pd-muted); font-size: calc(.86rem * var(--pf-tscale, 1)); line-height: 1.7; }

/* ───────── เมนู: มุมบนซ้ายในเกม (มุมล่างเป็นโต๊ะปรุง) · มุมบนขวาบนหน้าปก ───────── */
.pd-menu { position: absolute; z-index: 45; top: calc(10px + env(safe-area-inset-top, 0px)); left: calc(12px + env(safe-area-inset-left, 0px)); }
.pd-app.is-home .pd-menu { left: auto; right: calc(16px + env(safe-area-inset-right, 0px)); top: calc(16px + env(safe-area-inset-top, 0px)); }
.pd-menu-btn { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #f3d9a4; background: var(--pd-wood); color: #fff; font-size: 1.05rem; cursor: pointer; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); }
.pd-app.is-home .pd-menu-btn { background: rgba(30, 18, 6, .55); border-color: rgba(253, 230, 138, .7); backdrop-filter: blur(6px); }
.pd-menu-pop { position: absolute; left: 0; top: 56px; min-width: 240px; background: var(--pd-paper); border: 1.5px solid #e2c98f; border-radius: 14px; box-shadow: 0 12px 30px rgba(30, 15, 0, .4); padding: 10px; display: grid; gap: 3px; }
.pd-app.is-home .pd-menu-pop { left: auto; right: 0; }
.pd-menu-stats { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #f8ecd2; font-size: .78rem; font-weight: 800; color: #7c4a14; }
.pd-menu-pop button, .pd-menu-pop a { display: flex; align-items: center; gap: 10px; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: #4a3417; font: 700 .86rem "Sarabun", sans-serif; padding: 0 10px; cursor: pointer; text-decoration: none; text-align: left; }
.pd-menu-pop button:hover, .pd-menu-pop a:hover { background: #f8ecd2; color: #92400e; }
.pd-menu-pop i { width: 20px; color: #b45309; }
.pd-menu-scale { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.pd-menu-scale > span { flex: 1; display: flex; align-items: center; gap: 10px; color: #4a3417; font: 700 .86rem "Sarabun", sans-serif; }
.pd-menu-scale button { width: 44px; min-height: 44px; flex: none; justify-content: center; padding: 0; border: 2px solid #e2c98f; background: #fffaf0; color: #92400e; font-weight: 800; }
.pd-menu-scale button:disabled { opacity: .4; cursor: default; }

/* ───────── โต๊ะปรุง ───────── */
.pd-brew { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; gap: 7px;
	padding: calc(10px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px));
	max-width: 1120px; margin: 0 auto; }

.pd-order { position: relative; margin: 0 auto; width: min(760px, calc(100% - 110px)); text-align: center; padding: 7px 18px 9px;
	background: linear-gradient(180deg, #fffaf0, #f6e6c4); border: 2px solid var(--pd-brass); border-radius: 14px;
	box-shadow: 0 6px 18px rgba(40, 20, 0, .35), inset 0 0 0 3px rgba(255, 255, 255, .55); color: var(--pd-ink); }
.pd-order::before, .pd-order::after { content: ""; position: absolute; top: 50%; width: 12px; height: 70%; transform: translateY(-50%); border-radius: 6px; background: linear-gradient(90deg, #a16a28, #e5b86b, #a16a28); box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
.pd-order::before { left: -8px; } .pd-order::after { right: -8px; }
.pd-order-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; font-size: calc(.74rem * var(--pf-tscale, 1)); font-weight: 800; color: #8a5a1c; }
.pd-chip-line { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 1px 10px; color: #fff; background: #0e7490; }
.pd-chip-line.is-kitaka { background: #be123c; }
.pd-chip-hard { color: #6d28d9; }
.pd-order-title { margin: 3px 0 0; font-size: calc(.72rem * var(--pf-tscale, 1)); font-weight: 800; color: #a16207; letter-spacing: .02em; }
.pd-order-gloss { display: block; font-size: calc(clamp(1.15rem, 4.4vh, 1.85rem) * var(--pf-tscale, 1)); line-height: 1.55; color: #5b2c06; }
.pd-order-cues { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 2px; }
.pd-cue { display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px; border-radius: 999px; background: #fff; border: 1.5px solid var(--c, #d6c29a); color: var(--c, #6b4f2a); font-size: calc(.8rem * var(--pf-tscale, 1)); font-weight: 800; }
.pd-cue .pd-pali { font-size: 1.1em; }

/* ท่อกลั่น */
.pd-rail { list-style: none; margin: 0 auto; padding: 0 6px; display: flex; align-items: stretch; justify-content: center; gap: 0; position: relative; width: 100%; max-width: 980px; }
.pd-node { position: relative; flex: 1 1 0; min-width: 0; display: flex; justify-content: center; }
.pd-node + .pd-node::before { content: ""; position: absolute; left: -50%; right: 50%; top: 23px; height: 5px; z-index: 0; border-radius: 3px; background: linear-gradient(180deg, #f2c27c, #b0702c 60%, #7a4516); box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.pd-node-btn { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; padding: 0 2px; cursor: pointer; color: #fff; min-width: 0; max-width: 100%; }
.pd-node-btn:disabled { cursor: default; }
.pd-flask { position: relative; display: block; width: 40px; height: 46px; }
.pd-flask::before { content: ""; position: absolute; left: 50%; top: 0; width: 13px; height: 14px; transform: translateX(-50%); border: 2px solid rgba(255, 255, 255, .9); border-bottom: 0; border-radius: 3px 3px 0 0; background: rgba(255, 255, 255, .35); }
.pd-flask::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .95); background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .7), rgba(255, 255, 255, .18) 45%, rgba(255, 255, 255, .08)); box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }
.pd-flask-liquid { position: absolute; z-index: 1; left: 3px; right: 3px; bottom: 3px; border-radius: 0 0 40px 40px / 0 0 30px 30px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); transition: height .6s cubic-bezier(.3, 1.4, .5, 1); max-height: 28px; overflow: hidden; }
.pd-node.is-current .pd-flask::after { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 45%, transparent), 0 0 22px var(--c); }
.pd-node.is-current .pd-flask { animation: pd-bob 1.6s ease-in-out infinite; }
.pd-node.is-done .pd-flask-liquid::after { content: ""; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 30% 80%, rgba(255, 255, 255, .5) 0 2px, transparent 3px 9px); animation: pd-fizz 2.4s linear infinite; }
.pd-node.is-done .pd-node-btn::after { content: "\f00c"; font: 900 .62rem "Font Awesome 6 Free"; position: absolute; top: 12px; right: calc(50% - 28px); width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: #16a34a; color: #fff; border: 2px solid #fff; z-index: 2; }
.pd-node.is-skip .pd-flask-liquid { height: 0 !important; }
.pd-node-text { display: flex; flex-direction: column; align-items: center; background: rgba(42, 25, 8, .72); border-radius: 9px; padding: 1px 8px 2px; max-width: 100%; }
.pd-node-text small { font-size: calc(.66rem * var(--pf-tscale, 1)); font-weight: 800; color: #fde7b8; white-space: nowrap; }
.pd-node-val { font-size: calc(.84rem * var(--pf-tscale, 1)); color: #fff; max-width: 13ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-node.is-current .pd-node-text { background: var(--c); }
.pd-node-still { flex: 0 0 auto; padding-left: 10px; flex-direction: column; align-items: center; gap: 2px; }
.pd-node-still::before { left: -40px !important; right: 60% !important; }
/* ขั้นสุดท้ายบนราว = สัญลักษณ์บอกว่าถึงขั้นต้มแล้ว (กดที่ปุ่มต้มยาด้านล่าง) */
.pd-still-icon { position: relative; z-index: 1; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50% 50% 14px 14px; border: 2.5px solid rgba(243, 217, 164, .8);
	background: radial-gradient(circle at 35% 30%, #a8927a, #6b5644 70%); color: #e7dcc6; font-size: 1.1rem; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); transition: background .3s, color .3s; }
.pd-node-still .pd-node-text small { color: #fde7b8; }
.pd-node-still.is-ready .pd-still-icon { background: radial-gradient(circle at 35% 30%, #f7c177, #c2702a 55%, #7a3e10); color: #fff; animation: pd-pulse 1.4s ease-in-out infinite; }
.pd-node-still.is-boiling .pd-still-icon { animation: pd-rumble .16s linear infinite; }

/* ───────── หม้อแก้วกลางจอ ───────── */
.pd-pot-wrap { position: relative; flex: 1 1 0; min-height: 150px; }
.pd-pot { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); height: min(100%, 400px); aspect-ratio: 1.3 / 1; max-width: 100%; }
.pd-pot-rim { position: absolute; z-index: 3; left: 9%; right: 9%; top: 0; height: 9%; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .9);
	background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, .12)); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.pd-pot-glass { position: absolute; left: 4%; right: 4%; top: 4.5%; bottom: 0; overflow: hidden; border-radius: 16% 16% 46% 46% / 12% 12% 50% 50%;
	border: 3px solid rgba(255, 255, 255, .92); border-top: 0;
	background: radial-gradient(ellipse at 30% 25%, rgba(255, 255, 255, .55), rgba(255, 255, 255, .14) 40%, rgba(255, 255, 255, .06) 70%), rgba(40, 24, 8, .28);
	box-shadow: inset 0 -12px 30px rgba(255, 255, 255, .18), 0 18px 34px rgba(20, 10, 0, .45); backdrop-filter: blur(3px); }
.pd-pot-glass::after { content: ""; position: absolute; left: 12%; top: 10%; width: 9%; height: 46%; border-radius: 50%; background: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0)); pointer-events: none; z-index: 4; }
.pd-pot-liquid { position: absolute; left: 0; right: 0; bottom: 0; transition: height .6s cubic-bezier(.3, 1.4, .5, 1);
	background: linear-gradient(180deg, rgba(167, 243, 208, .62), rgba(52, 160, 140, .72) 55%, rgba(30, 96, 110, .82)); }
.pd-pot-liquid::before { content: ""; position: absolute; left: -5%; right: -5%; top: -9px; height: 18px; border-radius: 50%; background: rgba(209, 250, 229, .75); box-shadow: inset 0 -3px 6px rgba(20, 110, 100, .3); }
.pd-bubble { position: absolute; bottom: 4%; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .25); animation: pd-bubble 3.2s ease-in infinite; }
.pd-bubble:nth-child(1) { left: 14%; } .pd-bubble:nth-child(2) { left: 28%; animation-delay: .9s; width: 6px; height: 6px; } .pd-bubble:nth-child(3) { left: 43%; animation-delay: 1.7s; }
.pd-bubble:nth-child(4) { left: 57%; animation-delay: .4s; width: 12px; height: 12px; } .pd-bubble:nth-child(5) { left: 70%; animation-delay: 2.2s; } .pd-bubble:nth-child(6) { left: 82%; animation-delay: 1.2s; width: 7px; height: 7px; }
.pd-bubble:nth-child(7) { left: 36%; animation-delay: 2.7s; }
.pd-pot-chips { position: absolute; z-index: 2; left: 10%; right: 10%; top: 30%; bottom: 12%; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 10px 12px; }
.pd-pot .pd-pot-chip { font-size: calc(clamp(1.3rem, 3.2vh, 1.85rem) * var(--pf-tscale, 1)); padding: 2px 13px; box-shadow: 0 6px 14px rgba(10, 40, 40, .35);
	transform: translateY(var(--dy, 0)) rotate(var(--rot, 0deg));
	animation: pd-drop .55s cubic-bezier(.3, 1.5, .5, 1) backwards, pd-float var(--bob, 2.8s) ease-in-out .6s infinite alternate; }
.pd-pot-empty { position: absolute; z-index: 2; inset: 30% 10% 14%; display: grid; place-content: center; margin: 0; text-align: center; color: #fff8e7; font-weight: 800; font-size: calc(1rem * var(--pf-tscale, 1)); text-shadow: 0 1px 4px rgba(0, 0, 0, .55); }
.pd-pot-empty small { font-weight: 700; font-size: .8em; opacity: .9; }
/* ต้ม: ส่วนผสมหมุนวนรวมกันกลางหม้อ → ปิ๊ง! เป็นคำ */
.pd-pot-wrap.is-boiling .pd-pot-chips { animation: pd-vortex 1.15s cubic-bezier(.5, 0, .75, .3) forwards; }
.pd-pot-wrap.is-boiling .pd-pot .pd-pot-chip { animation: pd-swirl 1.15s ease-in forwards; }
.pd-pot-wrap.is-boiling .pd-pot-liquid { animation: pd-brewhue 1.2s linear infinite; }
.pd-pot-wrap.is-boiling .pd-bubble { animation-duration: .9s; }
.pd-pot-wrap.is-done .pd-pot-chips { display: none; }
.pd-pot-word { position: absolute; z-index: 5; left: 0; right: 0; top: 34%; text-align: center; font-size: calc(clamp(2.2rem, 7vh, 3.6rem) * var(--pf-tscale, 1)); color: #fff;
	text-shadow: 0 0 18px rgba(253, 230, 138, .95), 0 3px 0 rgba(120, 53, 15, .85), 0 6px 18px rgba(0, 0, 0, .45); animation: pd-ping .6s cubic-bezier(.2, 1.8, .4, 1) backwards; }
.pd-pot-flash { position: absolute; z-index: 4; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
	background: radial-gradient(circle, #fff, rgba(253, 230, 138, .9) 30%, rgba(253, 230, 138, 0) 70%); animation: pd-flash .8s ease-out forwards; pointer-events: none; }
.pd-pot-wrap.is-ready .pd-pot-glass { box-shadow: inset 0 -12px 30px rgba(255, 255, 255, .18), 0 0 0 4px rgba(251, 191, 36, .45), 0 0 34px rgba(251, 191, 36, .55); }

/* ชิปส่วนผสม (หม้อ · การ์ดเฉลย) */
.pd-plus { font-style: normal; color: #f3d9a4; font-weight: 900; }
.pd-part { display: inline-flex; flex-direction: column; align-items: center; padding: 1px 9px; border-radius: 9px; font-weight: 700; border: 1.5px solid; animation: pd-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.pd-part small { font-family: "Sarabun", sans-serif; font-size: .45em; font-weight: 800; opacity: .8; line-height: 1.1; }
.pd-part.is-prefix { color: var(--k-prefix); background: var(--k-prefix-bg); border-color: var(--k-prefix); }
.pd-part.is-agama { color: var(--k-agama); background: var(--k-agama-bg); border-color: var(--k-agama); border-style: dashed; }
.pd-part.is-dhatu { color: var(--k-dhatu); background: var(--k-dhatu-bg); border-color: var(--k-dhatu); }
.pd-part.is-vacaka { color: var(--k-vacaka); background: var(--k-vacaka-bg); border-color: var(--k-vacaka); }
.pd-part.is-kita { color: var(--k-kita); background: var(--k-kita-bg); border-color: var(--k-kita); }
.pd-part.is-fem { color: var(--k-fem); background: var(--k-fem-bg); border-color: var(--k-fem); }
.pd-part.is-vib { color: var(--k-vib); background: var(--k-vib-bg); border-color: var(--k-vib); }

/* โต๊ะสถานี */
.pd-bench { position: relative; flex: 0 1 auto; min-height: 0; max-height: 60%; overflow: auto; margin: 0 auto; width: min(980px, 100%); display: flex; flex-direction: column; gap: 7px;
	background: var(--pd-glass); border-radius: 18px; border-top: 5px solid var(--c); padding: 9px 14px 11px; box-shadow: 0 10px 28px rgba(30, 15, 0, .45); -webkit-overflow-scrolling: touch; }
.pd-bench.is-shake { animation: pd-shake .38s ease 2; }
.pd-bench-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.pd-bench-head { flex: 1 1 300px; min-width: 0; }
.pd-bench-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: calc(1.15rem * var(--pf-tscale, 1)); color: var(--c); }
.pd-bench-head p { margin: 1px 0 0; font-size: calc(.95rem * var(--pf-tscale, 1)); color: var(--pd-muted); line-height: 1.55; }
.pd-gana-cue { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px; margin: 5px 0 0 !important; padding: 4px 12px; border-radius: 10px; color: #3f2d19 !important; font-weight: 700;
	background: color-mix(in srgb, var(--gc, #b45309) 12%, #fff); border: 1.5px solid color-mix(in srgb, var(--gc, #b45309) 55%, #fff); font-size: calc(.86rem * var(--pf-tscale, 1)) !important; }
.pd-gana-cue i { color: var(--gc, #b45309); margin-right: 3px; }
.pd-gana-cue b { color: var(--gc, #92400e); font-size: 1.15em; }
.pd-ready .pd-bench-head { flex: none; }   /* หัวโต๊ะปกติวางในแถวแนวนอน (flex-basis ๓๐๐px) — ในแผงแนวตั้งต้องไม่ยืด */
.pd-ready .pd-bench-head h2 { color: #c2410c; }
.pd-ready-list { display: flex; flex-wrap: wrap; gap: 7px; }
.pd-ready-item { display: flex; flex-direction: column; align-items: center; min-width: 88px; min-height: 52px; padding: 3px 12px 5px; border-radius: 12px; cursor: pointer;
	border: 2px solid color-mix(in srgb, var(--c) 55%, #fff); background: color-mix(in srgb, var(--c) 8%, #fff); color: var(--pd-ink); }
.pd-ready-item small { font-size: calc(.68rem * var(--pf-tscale, 1)); font-weight: 800; color: var(--c); }
.pd-ready-item b { font-size: calc(1.1rem * var(--pf-tscale, 1)); }
.pd-ready-item:hover:not(:disabled) { background: color-mix(in srgb, var(--c) 16%, #fff); }
.pd-btn-boil { min-height: 54px; padding: 0 30px; font-size: calc(1.1rem * var(--pf-tscale, 1)); --c: #c2410c; }
.pd-btn-boil:not(:disabled) { animation: pd-glowbtn 1.4s ease-in-out infinite; }   /* เรืองแสงอย่างเดียว ไม่ขยับขนาด — ปุ่มต้องนิ่งให้กดง่าย */
.pd-flask-sm { width: 22px; height: 26px; }
.pd-flask-sm::before { width: 8px; height: 8px; border-width: 1.5px; border-color: var(--c); background: #fff; }
.pd-flask-sm::after { height: 19px; border-width: 2px; border-color: var(--c); box-shadow: none; }
.pd-flask-sm .pd-flask-liquid { max-height: 15px; left: 2px; right: 2px; bottom: 2px; }

.pd-slots { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.pd-slot { min-width: 70px; display: flex; flex-direction: column; align-items: center; padding: 2px 10px 4px; border-radius: 11px; border: 2px dashed color-mix(in srgb, var(--c) 45%, #d6cbb5); background: #fff; }
.pd-slot small { font-size: calc(.78rem * var(--pf-tscale, 1)); font-weight: 800; color: var(--pd-muted); }
.pd-slot b { font-size: calc(1.05rem * var(--pf-tscale, 1)); color: #a8a29e; min-height: 1.4em; }
.pd-slot.is-filled { border-style: solid; border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); }
.pd-slot.is-filled b { color: var(--pd-ink); cursor: pointer; }
.pd-slot.is-filled b::after { content: " ×"; font-family: "Sarabun", sans-serif; font-size: .55em; color: #a8a29e; }
.pd-slot-none { align-self: center; color: var(--pd-muted); font-size: calc(.8rem * var(--pf-tscale, 1)); font-weight: 700; }

.pd-shelves { display: flex; flex-direction: column; gap: 6px; }
.pd-shelf { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.pd-shelf-label { flex: 0 0 auto; min-width: 64px; font-size: calc(.88rem * var(--pf-tscale, 1)); font-weight: 800; color: #7c5a2c; }
.pd-bottle { --bc: var(--c); position: relative; min-width: 56px; min-height: 48px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px 11px; border-radius: 12px 12px 14px 14px; cursor: pointer;
	border: 2px solid color-mix(in srgb, var(--bc) 55%, #e7dcc6); background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--bc) 7%, #fff)); color: var(--pd-ink); font-weight: 700;
	font-size: calc(1.15rem * var(--pf-tscale, 1)); transition: transform .12s ease, box-shadow .12s ease; box-shadow: 0 2px 0 color-mix(in srgb, var(--bc) 30%, #e7dcc6); }
.pd-bottle::before { content: ""; position: absolute; top: -2px; left: 50%; width: 42%; height: 5px; transform: translateX(-50%); border-radius: 0 0 5px 5px; background: var(--gc, color-mix(in srgb, var(--bc) 70%, #fff)); }
.pd-bottle small { font-family: "Sarabun", sans-serif; font-size: calc(.72rem * var(--pf-tscale, 1)); font-weight: 700; color: var(--pd-muted); line-height: 1.2; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-bottle:hover { transform: translateY(-2px); box-shadow: 0 5px 10px color-mix(in srgb, var(--bc) 30%, transparent); }
.pd-bottle:active { transform: translateY(1px) scale(.97); }
.pd-bottle.is-used, .pd-bottle.is-picked { background: color-mix(in srgb, var(--bc) 16%, #fff); border-color: var(--bc); }
.pd-bottle.is-prefix { --bc: var(--k-prefix); }
.pd-bottle.is-agama { --bc: var(--k-agama); border-style: dashed; }
.pd-bottle.is-dhatu { --bc: var(--k-dhatu); min-width: 84px; min-height: 64px; padding: 3px 14px 4px; }
.pd-bottle.is-dhatu .pd-pali { font-size: 1.5em; line-height: 1.45; }   /* เชิง ฏ ฐ ญ ต้องไม่ชนป้ายความหมาย */
.pd-bottle.is-dhatu small { font-size: calc(.74rem * var(--pf-tscale, 1)); max-width: 14ch; margin-top: .3em; }
.pd-bottle.is-fem { --bc: var(--k-fem); }
.pd-bottle.is-vib, .pd-bottle.is-linga { --bc: var(--k-vib); }
.pd-bottle.is-linga { font-size: calc(.84rem * var(--pf-tscale, 1)); }

/* วาจก ๕ */
.pd-vacaka-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.pd-vacaka-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 64px; padding: 6px 6px; border-radius: 14px; border: 2px solid color-mix(in srgb, var(--c) 55%, #fff); background: #fff; color: var(--c); cursor: pointer; transition: transform .12s ease; }
.pd-vacaka-btn i { font-size: 1.1rem; }
.pd-vacaka-btn b { font-size: calc(1.05rem * var(--pf-tscale, 1)); }
.pd-vacaka-btn small { font-size: calc(.78rem * var(--pf-tscale, 1)); color: var(--pd-muted); line-height: 1.35; }
.pd-vacaka-btn:hover { transform: translateY(-2px); }
.pd-vacaka-btn.is-picked { background: var(--c); color: #fff; }
.pd-vacaka-btn.is-picked small { color: rgba(255, 255, 255, .9); }
.pd-vacaka-btn.is-wrong { animation: pd-shake .35s ease; }

/* ลิ้นชักวิภัตติ */
.pd-drawer { display: flex; flex-direction: column; gap: 7px; padding: 9px 10px; border-radius: 14px; background: linear-gradient(180deg, #f6ead2, #ecd9b3); border: 2px solid #c8a36a; }
.pd-drawer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pd-drawer-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; padding: 3px 12px; border-radius: 10px; border: 1.5px solid #c8a36a; background: #fffaf0; color: #5b3a12; cursor: pointer; font-weight: 800; font-size: calc(1.12rem * var(--pf-tscale, 1)); }
.pd-drawer-btn small { font-size: calc(.8rem * var(--pf-tscale, 1)); font-weight: 700; color: #8a6a3c; max-width: 13ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-drawer-btn.is-small { min-height: 44px; }
.pd-drawer-btn.is-on { background: var(--k-vib); border-color: var(--k-vib); color: #fff; }
.pd-drawer-btn.is-on small { color: #ede9fe; }
.pd-drawer-row .pd-shelf-label { min-width: 0; margin-left: 6px; }
.pd-drawer-open { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 50px; padding: 6px 10px; border-radius: 11px; background: #fff; border: 2px dashed #c8a36a; color: var(--pd-muted); font-size: calc(.98rem * var(--pf-tscale, 1)); font-weight: 700; }
.pd-drawer-open.is-ready { border-style: solid; border-color: var(--k-vib); background: var(--k-vib-bg); animation: pd-pop .3s ease; }
.pd-drawer-open.is-locked { background: #f5f5f4; color: #78716c; }
.pd-drawer-ending { font-size: calc(2.3rem * var(--pf-tscale, 1)); color: var(--k-vib); font-weight: 700; }
.pd-drawer-info { flex: 1 1 220px; color: #4c1d95; line-height: 1.55; }
.pd-drawer-put { --bc: var(--k-vib); flex-direction: row; gap: 6px; font-family: "Sarabun", sans-serif; font-size: calc(1rem * var(--pf-tscale, 1)); background: var(--k-vib); color: #fff; }

.pd-hint { margin: 0; display: flex; gap: 8px; align-items: flex-start; padding: 8px 13px; border-radius: 11px; background: #fffbeb; border: 1.5px solid #fcd34d; color: #92400e; font-size: calc(.98rem * var(--pf-tscale, 1)); font-weight: 700; line-height: 1.6; animation: pd-pop .3s ease; }
.pd-hint i { margin-top: 4px; color: #f59e0b; }

.pd-bench-actions { position: sticky; bottom: -11px; z-index: 3; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin: auto -14px -11px; padding: 8px 14px 10px;
	background: linear-gradient(180deg, rgba(255, 251, 242, 0), rgba(255, 251, 242, .97) 32%); }
.pd-btn-main, .pd-btn-ghost { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border-radius: 12px; font: 800 calc(.92rem * var(--pf-tscale, 1)) "Sarabun", sans-serif; cursor: pointer; text-decoration: none; }
.pd-btn-main { border: 0; color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--c, #b45309) 88%, #fff), var(--c, #b45309)); box-shadow: 0 3px 0 color-mix(in srgb, var(--c, #b45309) 60%, #000); }
.pd-btn-main:disabled { opacity: .45; cursor: default; }
.pd-btn-main:not(:disabled):hover { filter: brightness(1.06); }
.pd-btn-ghost { border: 1.5px solid #d6c29a; background: #fffaf0; color: #7c5a2c; }
.pd-btn-ghost:hover { background: #f8ecd2; }

/* ไอน้ำ / ควัน */
.pd-steam { position: absolute; right: 7%; top: 18%; width: 140px; height: 160px; pointer-events: none; z-index: 9; }
.pd-steam i { position: absolute; bottom: 0; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 237, 213, .1)); animation: pd-steam 1.3s ease-out infinite; }
.pd-steam i:nth-child(2) { left: 20%; animation-delay: .15s; } .pd-steam i:nth-child(3) { left: 40%; animation-delay: .3s; width: 34px; height: 34px; }
.pd-steam i:nth-child(4) { left: 60%; animation-delay: .45s; } .pd-steam i:nth-child(5) { left: 75%; animation-delay: .6s; width: 20px; height: 20px; }
.pd-steam i:nth-child(6) { left: 10%; animation-delay: .75s; } .pd-steam i:nth-child(7) { left: 50%; animation-delay: .9s; }
.pd-smoke { position: absolute; left: 50%; top: 45%; z-index: 9; font-size: 3.2rem; color: #78716c; pointer-events: none; animation: pd-smoke .8s ease-out forwards; }

/* ───────── การ์ดขวดยาสำเร็จ ───────── */
.pd-served-backdrop { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 12px; background: rgba(28, 16, 4, .62); }
.pd-served { position: relative; width: min(780px, 100%); max-height: calc(100dvh - 24px); overflow: auto; padding: 14px 20px 16px; border-radius: 20px;
	background: linear-gradient(180deg, #fffaf0, #f8ecd2); border: 2px solid var(--pd-brass); box-shadow: 0 18px 44px rgba(0, 0, 0, .5); color: var(--pd-ink); animation: pd-rise .45s cubic-bezier(.2, 1.3, .4, 1); }
/* พับการ์ด: แถบล่าง ไม่มีฉากมืด — หม้อกับคำตัวใหญ่โผล่เต็ม */
.pd-served-backdrop.is-min { background: transparent; pointer-events: none; place-items: end center; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.pd-served-mini { pointer-events: auto; display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 10px; width: min(780px, 100%); padding: 10px 14px; border-radius: 18px;
	background: linear-gradient(180deg, #fffaf0, #f8ecd2); border: 2px solid var(--pd-brass); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); animation: pd-rise .35s cubic-bezier(.2, 1.3, .4, 1); }
.pd-mini-open { flex: 1 1 260px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-height: 48px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--pd-ink); }
.pd-mini-open b { font-size: calc(1.7rem * var(--pf-tscale, 1)); color: #3b1d05; }
.pd-mini-open > span:not(.pd-stars) { font-weight: 800; color: #5b3a12; font-size: calc(.95rem * var(--pf-tscale, 1)); }
.pd-mini-open em { font-style: normal; font-weight: 800; color: var(--vc); font-size: calc(.88rem * var(--pf-tscale, 1)); }
.pd-served-min { position: absolute; top: 12px; right: 14px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid #d6c29a; background: #fffaf0; color: #7c5a2c; font-weight: 800; font-size: calc(.86rem * var(--pf-tscale, 1)); cursor: pointer; z-index: 2; }
.pd-served-min:hover { background: #f8ecd2; }
.pd-served-top { padding-right: 112px; }
.pd-served-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pd-served-tag { display: inline-flex; align-items: center; gap: 7px; padding: 4px 13px; border-radius: 999px; background: var(--vc); color: #fff; font-weight: 800; font-size: calc(.8rem * var(--pf-tscale, 1)); }
.pd-stars { display: inline-flex; gap: 3px; font-size: 1.25rem; }
.pd-stars i { color: #e7dcc6; }
.pd-stars i.is-on { color: #f59e0b; filter: drop-shadow(0 1px 2px rgba(180, 83, 9, .4)); animation: pd-star .5s cubic-bezier(.3, 1.8, .5, 1) backwards; }
.pd-stars i.is-on:nth-child(2) { animation-delay: .15s; } .pd-stars i.is-on:nth-child(3) { animation-delay: .3s; }
.pd-stars.is-small { font-size: .78rem; }
.pd-stars.is-big { font-size: 1.4rem; font-weight: 900; color: #92400e; gap: 8px; justify-content: center; display: flex; margin: 6px 0; }
.pd-potion { display: flex; align-items: center; gap: 16px; margin: 8px 0 4px; }
.pd-potion-bottle { position: relative; flex: 0 0 auto; width: 58px; height: 68px; }
.pd-potion-bottle::before { content: ""; position: absolute; left: 50%; top: 0; width: 18px; height: 18px; transform: translateX(-50%); border: 3px solid #8a5a1c; border-bottom: 0; border-radius: 4px 4px 0 0; background: #f3d9a4; }
.pd-potion-bottle i { position: absolute; left: 0; right: 0; bottom: 0; height: 52px; border-radius: 50%; border: 3px solid #fff; overflow: hidden; box-shadow: 0 0 0 2px var(--vc), 0 0 24px color-mix(in srgb, var(--vc) 60%, transparent);
	background: linear-gradient(180deg, rgba(255, 255, 255, .5) 0 30%, var(--vc) 30%); animation: pd-glow 2s ease-in-out infinite; }
.pd-potion strong { display: block; font-size: calc(2.1rem * var(--pf-tscale, 1)); color: #3b1d05; }
.pd-say { vertical-align: middle; margin-left: 12px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--vc) 55%, #fff); background: #fff; color: var(--vc); font-size: 1.05rem; cursor: pointer; box-shadow: 0 2px 6px rgba(60, 30, 0, .18); }
.pd-say:hover { background: color-mix(in srgb, var(--vc) 10%, #fff); }
.pd-potion em { display: block; font-style: normal; font-weight: 800; color: #5b3a12; font-size: calc(1rem * var(--pf-tscale, 1)); }
.pd-anatomy { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 5px; padding: 8px 10px; border-radius: 14px; background: #fff; border: 1.5px solid #e7d7b5; }
.pd-anatomy .pd-part { font-size: calc(1rem * var(--pf-tscale, 1)); }
.pd-anatomy .pd-part small { font-size: .5em; }
.pd-anatomy > strong { font-size: calc(1.5rem * var(--pf-tscale, 1)); color: #b45309; }
.pd-arrow { font-style: normal; color: #b45309; margin: 0 2px; }
.pd-facts { margin: 8px 0 0; display: grid; gap: 3px; }
.pd-facts p { margin: 0; font-size: calc(.84rem * var(--pf-tscale, 1)); line-height: 1.7; color: #3f2d19; }
.pd-facts .pd-pali { font-size: 1.06em; }
.pd-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: .05em; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, .1); }
.pd-steps { margin: 10px 0 0; padding: 8px 12px 9px; border-radius: 14px; background: #faf5ff; border: 1.5px solid #ddd6fe; }
.pd-steps-head { display: block; font-size: calc(.82rem * var(--pf-tscale, 1)); font-weight: 800; color: #6d28d9; }
.pd-steps ol { list-style: none; margin: 5px 0 3px; padding: 0; display: grid; gap: 3px; }
.pd-steps li { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 10px; align-items: center; padding: 2px 6px; border-radius: 8px; opacity: 0; transform: translateX(-10px); transition: opacity .35s ease, transform .35s ease; }
.pd-steps li.is-shown { opacity: 1; transform: none; }
.pd-steps li:nth-child(odd) { background: rgba(255, 255, 255, .7); }
.pd-step-rule { justify-self: start; font-size: calc(.72rem * var(--pf-tscale, 1)); font-weight: 800; color: #5b21b6; background: #ede9fe; border-radius: 999px; padding: 1px 10px; }
.pd-step-parts { font-size: calc(1.08rem * var(--pf-tscale, 1)); color: #2e1065; }
.pd-step-final .pd-step-rule { background: #b45309; color: #fff; }
.pd-step-final b { color: #b45309; font-size: 1.12em; }
.pd-legend { color: #7c6aa8; font-size: calc(.68rem * var(--pf-tscale, 1)); }
.pd-step-part { margin-right: .28em; }
.pd-step-part.is-changed { color: #c2410c; font-weight: 800; }
.pd-step-part.is-struck { text-decoration: line-through; opacity: .55; }
.pd-nosteps { margin: 10px 0 0; font-size: calc(.8rem * var(--pf-tscale, 1)); color: var(--pd-muted); background: #fff; border-radius: 10px; padding: 6px 10px; }
.pd-explain { margin: 9px 0 0; padding: 7px 12px; border-left: 4px solid var(--pd-brass); background: rgba(255, 255, 255, .7); border-radius: 0 10px 10px 0; font-size: calc(.84rem * var(--pf-tscale, 1)); line-height: 1.75; color: #4a3417; }
.pd-explain i { color: var(--pd-brass); margin-right: 6px; }
.pd-note { margin: 4px 0 0; font-size: calc(.78rem * var(--pf-tscale, 1)); color: var(--pd-muted); }
.pd-ref { display: block; margin-top: 7px; color: #9a8466; font-size: calc(.7rem * var(--pf-tscale, 1)); }
.pd-served-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.pd-served .pd-btn-main, .pd-result .pd-btn-main, .pd-levels .pd-btn-main { --c: #b45309; }

/* ───────── แผงทั่วไป (ปก · ระดับ · ตำรา · สรุป) ───────── */
.pd-cover { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; overflow: auto; background: rgba(28, 16, 4, .5); padding: 12px; }
.pd-panel { position: relative; width: min(900px, 100%); max-height: calc(100dvh - 24px); overflow: auto; border-radius: 20px; background: linear-gradient(180deg, #fffaf0, #f6e6c4);
	border: 2px solid var(--pd-brass); box-shadow: 0 18px 44px rgba(0, 0, 0, .45), inset 0 0 0 4px rgba(255, 255, 255, .5); color: var(--pd-ink); animation: pd-rise .4s cubic-bezier(.2, 1.3, .4, 1); }
.pd-panel-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px 9px; background: linear-gradient(180deg, #fffaf0 70%, rgba(255, 250, 240, .9)); border-bottom: 1px solid #ecd9b3; }
.pd-panel-head span { color: #a16207; font-size: calc(.74rem * var(--pf-tscale, 1)); font-weight: 800; }
.pd-panel-head h2 { margin: 1px 0 0; font-size: calc(1.3rem * var(--pf-tscale, 1)); color: #5b2c06; }
.pd-x { width: 42px; height: 42px; flex: none; border: 0; border-radius: 12px; background: #fde68a; color: #92400e; cursor: pointer; font-size: 1rem; }
.pd-panel-intro { margin: 10px 18px 4px; color: #57442b; font-size: calc(.88rem * var(--pf-tscale, 1)); line-height: 1.75; }
.pd-panel-foot { padding: 6px 18px 16px; }
.pd-kicker { color: #a16207; font-size: calc(.76rem * var(--pf-tscale, 1)); font-weight: 800; }

/* ───────── หน้าปก: คีย์อาร์ตเต็มจอ ───────── */
.pd-home { position: absolute; inset: 0; z-index: 20; overflow-y: auto; overflow-x: hidden; color: #fff8e7; background: #1c1004; -webkit-overflow-scrolling: touch; }
.pd-home-art { position: absolute; inset: 0; background: url(/assets/game/dhatu-lab/key-art.jpg) 70% 50% / cover no-repeat; }
.pd-home-art::after { content: ""; position: absolute; inset: 0;
	background: linear-gradient(90deg, rgba(24, 13, 3, .96) 0%, rgba(24, 13, 3, .9) 34%, rgba(24, 13, 3, .55) 48%, rgba(24, 13, 3, 0) 64%),
		linear-gradient(0deg, rgba(24, 13, 3, .55), rgba(24, 13, 3, 0) 30%); }
.pd-home-back { position: absolute; z-index: 2; top: calc(16px + env(safe-area-inset-top, 0px)); left: calc(16px + env(safe-area-inset-left, 0px)); display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 16px;
	border-radius: 12px; border: 1.5px solid rgba(253, 230, 138, .55); background: rgba(30, 18, 6, .55); backdrop-filter: blur(6px); color: #fff8e7; font-weight: 800; font-size: .92rem; text-decoration: none; }
.pd-home-back:hover { background: rgba(30, 18, 6, .8); }
.pd-home-body { position: relative; z-index: 1; min-height: 100%; width: min(640px, 100%); display: flex; flex-direction: column; justify-content: center; gap: 10px;
	padding: calc(84px + env(safe-area-inset-top, 0px)) 24px calc(28px + env(safe-area-inset-bottom, 0px)) calc(max(24px, 6vw) + env(safe-area-inset-left, 0px)); }
.pd-home-kicker { color: #fcd34d; font-weight: 800; font-size: calc(.86rem * var(--pf-tscale, 1)); letter-spacing: .02em; }
.pd-home h1 { margin: 0; font-size: calc(clamp(2.6rem, 6.2vw, 4.4rem) * var(--pf-tscale, 1)); line-height: 1.25; color: #fff; text-shadow: 0 4px 24px rgba(0, 0, 0, .55); }
.pd-home-sub { text-wrap: balance; margin: -4px 0 0; color: #fde68a; font-weight: 700; font-size: calc(clamp(1.05rem, 1.8vw, 1.3rem) * var(--pf-tscale, 1)); }
.pd-home-say { margin: 2px 0 4px; color: #f5e9d1; font-size: calc(.95rem * var(--pf-tscale, 1)); line-height: 1.8; }
.pd-home-say b { font-weight: 800; }
.pd-home-say .is-dhatu { color: #fbbf24; } .pd-home-say .is-vacaka { color: #4ade80; } .pd-home-say .is-vpac { color: #7dd3fc; }
.pd-home-say .is-kita { color: #f9a8d4; } .pd-home-say .is-vib { color: #c4b5fd; }
.pd-home-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 4px 0 2px; }
.pd-mode { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 11px; align-items: center; text-align: left; min-height: 66px; padding: 10px 14px; border-radius: 16px; border: 1.5px solid rgba(255, 255, 255, .18); cursor: pointer; color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .3), 0 10px 24px rgba(0, 0, 0, .25); transition: transform .12s ease, filter .12s ease; }
.pd-mode:hover { transform: translateY(-2px); filter: brightness(1.08); }
.pd-mode i { grid-row: 1 / 3; font-size: 1.5rem; }
.pd-mode b { font-size: calc(1.05rem * var(--pf-tscale, 1)); }
.pd-mode small { font-size: calc(.72rem * var(--pf-tscale, 1)); opacity: .92; line-height: 1.4; text-wrap: balance; }
.pd-mode span { position: absolute; top: 8px; right: 10px; font-size: .72rem; font-weight: 800; background: rgba(255, 255, 255, .22); border-radius: 999px; padding: 0 8px; }
.pd-mode.is-akhyata { background: linear-gradient(135deg, #0e7490, #155e75); }
.pd-mode.is-kitaka { background: linear-gradient(135deg, #be123c, #9f1239); }
.pd-mode.is-taste { background: linear-gradient(135deg, #7c3aed, #5b21b6); }
.pd-mode.is-book { background: linear-gradient(135deg, #a16207, #78350f); }
.pd-home-stats { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pd-home-stats li { display: flex; flex-direction: column; min-width: 120px; padding: 7px 13px; border-radius: 12px; background: rgba(30, 18, 6, .55); border: 1px solid rgba(253, 230, 138, .25); }
.pd-home-stats b { font-size: 1.25rem; color: #fff; line-height: 1.3; }
.pd-home-stats b small { font-size: .7em; color: #e7d3ad; font-weight: 700; }
.pd-home-stats b i { color: #fbbf24; font-size: .85em; }
.pd-home-stats span { font-size: .74rem; font-weight: 700; color: #e7d3ad; }
.pd-home .pd-sync { margin: 0; background: rgba(30, 18, 6, .55); border-color: rgba(253, 230, 138, .25); color: #e7d3ad; }
.pd-home .pd-sync a { color: #fcd34d; }
.pd-home .pd-sync.is-saved { color: #86efac; background: rgba(6, 40, 26, .6); border-color: rgba(134, 239, 172, .35); }
.pd-home .pd-sync.is-error, .pd-home .pd-sync.is-unverified { color: #fdba74; background: rgba(50, 20, 4, .6); border-color: rgba(253, 186, 116, .35); }

/* นกฮูกหมอยา (ตัดจากคีย์อาร์ต) */
.pd-owl { flex: none; width: 58px; height: 58px; border-radius: 50%; border: 3px solid #fde68a; box-shadow: 0 3px 10px rgba(120, 60, 0, .3);
	background: url(/assets/game/dhatu-lab/key-art.jpg) -160px -50px / 264px auto no-repeat; }
.pd-owl-line { display: flex; align-items: center; gap: 12px; margin: 14px 0 12px; text-align: left; color: #4a3417; font-size: calc(.88rem * var(--pf-tscale, 1)); line-height: 1.65; }

/* เลือกระดับ */
.pd-level-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; padding: 8px 18px 6px; }
.pd-level-card { position: relative; display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 12px 14px 11px 54px; border-radius: 16px; border: 2px solid #e2c98f; background: #fff; cursor: pointer; color: var(--pd-ink); transition: transform .12s ease, box-shadow .12s ease; }
.pd-level-card:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(120, 70, 10, .2); border-color: #c8973a; }
.pd-level-card:disabled { cursor: default; }
.pd-level-card.is-locked { background: #f5f0e6; color: #9a8466; }
.pd-level-card.is-empty:not(.is-locked) { opacity: .7; }
.pd-level-no { position: absolute; left: 12px; top: 12px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f7c177, #b45309); color: #fff; font-weight: 900; }
.pd-level-card.is-locked .pd-level-no { background: #cbbfa6; }
.pd-level-card b { font-size: calc(1rem * var(--pf-tscale, 1)); }
.pd-level-card small { color: var(--pd-muted); font-size: calc(.74rem * var(--pf-tscale, 1)); line-height: 1.5; }
.pd-level-bar { height: 7px; border-radius: 99px; background: #f1e6cf; overflow: hidden; margin-top: 3px; }
.pd-level-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f59e0b, #16a34a); transition: width .6s ease; }
.pd-level-stat { font-size: calc(.72rem * var(--pf-tscale, 1)); font-weight: 800; color: #8a6a3c; }
.pd-level-stat .fa-star { color: #f59e0b; }
.pd-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: calc(.82rem * var(--pf-tscale, 1)); font-weight: 700; color: #57442b; }
.pd-toggle input { position: absolute; opacity: 0; }
.pd-toggle span { flex: none; position: relative; width: 44px; height: 24px; border-radius: 99px; background: #d6c29a; transition: background .2s; }
.pd-toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.pd-toggle input:checked + span { background: #6d28d9; }
.pd-toggle input:checked + span::after { transform: translateX(20px); }
.pd-toggle input:focus-visible + span { outline: 3px solid #fbbf24; outline-offset: 2px; }

/* ตำรับยา */
.pd-book { width: min(980px, 100%); }
.pd-tabs { position: sticky; top: 66px; z-index: 2; display: flex; gap: 5px; overflow-x: auto; padding: 8px 18px; background: #fbf1dc; border-bottom: 1px solid #ecd9b3; }
.pd-tabs button { flex: none; min-height: 38px; border: 1.5px solid #d6c29a; border-radius: 999px; background: #fffaf0; color: #6b4f2a; font-weight: 800; font-size: calc(.8rem * var(--pf-tscale, 1)); padding: 0 13px; cursor: pointer; }
.pd-tabs button.is-on { background: #92400e; border-color: #92400e; color: #fff; }
.pd-book-body { padding: 8px 18px 18px; }
.pd-quote { margin: 8px 0; padding: 8px 12px; border-left: 4px solid var(--pd-brass); background: rgba(255, 255, 255, .7); border-radius: 0 10px 10px 0; color: #4a3417; font-size: calc(.84rem * var(--pf-tscale, 1)); line-height: 1.75; }
.pd-quote small { color: #9a8466; }
.pd-gana-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 9px; }
.pd-gana-grid article { border-radius: 14px; background: #fff; border: 2px solid color-mix(in srgb, var(--c) 50%, #fff); border-top-width: 6px; border-top-color: var(--c); padding: 8px 11px; }
.pd-gana-grid h3 { margin: 0; font-size: calc(1rem * var(--pf-tscale, 1)); color: var(--c); display: flex; align-items: baseline; gap: 6px; }
.pd-gana-grid h3 small { font-size: .72em; color: var(--pd-muted); }
.pd-gana-grid p { margin: 3px 0 0; font-size: calc(.8rem * var(--pf-tscale, 1)); color: #4a3417; }
.pd-gana-pac b { color: var(--c); font-size: 1.35em; }
.pd-gana-roots { display: flex; flex-wrap: wrap; gap: 4px; }
.pd-gana-roots span { background: color-mix(in srgb, var(--c) 12%, #fff); color: #3f2d19; border-radius: 7px; padding: 0 6px; font-size: .92em; }
.pd-vacaka-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pd-vacaka-cards article { border-radius: 14px; background: #fff; border: 2px solid color-mix(in srgb, var(--c) 45%, #fff); padding: 9px 12px; }
.pd-vacaka-cards h3 { margin: 0 0 4px; color: var(--c); font-size: calc(1rem * var(--pf-tscale, 1)); display: flex; gap: 8px; align-items: center; }
.pd-vacaka-cards .pd-quote { margin: 4px 0; border-left-color: var(--c); font-size: calc(.78rem * var(--pf-tscale, 1)); }
.pd-vacaka-cards p { margin: 4px 0 0; font-size: calc(.8rem * var(--pf-tscale, 1)); color: #4a3417; line-height: 1.6; }
.pd-ex { background: #fffaf0; border: 1px dashed #d6c29a; border-radius: 10px; padding: 5px 9px; }
.pd-vibtable-cats { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.pd-vibtable-cats button { display: inline-flex; flex-direction: column; align-items: center; min-height: 42px; padding: 2px 10px; border: 1.5px solid #c8a36a; border-radius: 10px; background: #fffaf0; color: #5b3a12; font-weight: 800; font-size: calc(.8rem * var(--pf-tscale, 1)); cursor: pointer; }
.pd-vibtable-cats small { font-size: .7em; color: #8a6a3c; font-weight: 700; }
.pd-vibtable-cats button.is-on { background: var(--k-vib); border-color: var(--k-vib); color: #fff; }
.pd-vibtable-cats button.is-on small { color: #ede9fe; }
.pd-vibtable { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.pd-vibtable table { border-collapse: separate; border-spacing: 3px; font-size: calc(.78rem * var(--pf-tscale, 1)); }
.pd-vibtable th { color: #7c5a2c; font-weight: 800; padding: 2px 6px; }
.pd-vibtable td button { position: relative; min-width: 62px; min-height: 40px; border: 1.5px solid #ddd6fe; border-radius: 9px; background: #fff; color: #4c1d95; cursor: pointer; font-size: 1.2rem; }
.pd-vibtable td button.has-forms::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #16a34a; }
.pd-vibtable td button.is-on { background: var(--k-vib); color: #fff; border-color: var(--k-vib); }
.pd-vibcell { background: #fff; border-radius: 14px; border: 1.5px solid #ddd6fe; padding: 9px 12px; min-height: 150px; }
.pd-vibcell > strong { font-size: calc(2rem * var(--pf-tscale, 1)); color: var(--k-vib); }
.pd-vibcell p { margin: 3px 0; font-size: calc(.8rem * var(--pf-tscale, 1)); line-height: 1.65; color: #3b2a4f; }
.pd-cellforms { display: flex; flex-wrap: wrap; gap: 5px; align-items: baseline; margin-top: 4px; }
.pd-cellforms > small { width: 100%; color: #7c6aa8; font-weight: 800; font-size: .72rem; }
.pd-cellforms span { background: #f5f3ff; border-radius: 8px; padding: 1px 8px; }
.pd-cellforms span small { color: #7c6aa8; font-size: .7rem; }
.pd-kita-table { width: 100%; border-collapse: collapse; font-size: calc(.8rem * var(--pf-tscale, 1)); background: #fff; border-radius: 12px; overflow: hidden; }
.pd-kita-table th, .pd-kita-table td { padding: 4px 8px; border-bottom: 1px solid #f1e6cf; text-align: center; }
.pd-kita-table th { background: #fbf1dc; font-weight: 800; color: #6b4f2a; font-size: .9em; }
.pd-kita-table td:first-child { font-size: 1.12rem; color: var(--k-kita); }
.pd-kita-table td:nth-child(2), .pd-kita-table td:last-child { text-align: left; color: #57442b; }
.pd-kita-mark { color: #16a34a; font-weight: 900; }
.pd-mybook { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.pd-mybook-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 7px 11px; border-radius: 12px; border: 2px solid color-mix(in srgb, var(--vc) 40%, #fff); border-left: 6px solid var(--vc); background: #fff; cursor: pointer; }
.pd-mybook-item b { font-size: 1.28rem; color: #3b1d05; }
.pd-mybook-item small { font-size: .74rem; color: var(--pd-muted); }

/* ชิมยา */
.pd-taste { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 12px; }
.pd-taste-word { font-size: calc(clamp(1.8rem, 7vh, 2.6rem) * var(--pf-tscale, 1)) !important; color: #3b1d05 !important; }
.pd-taste-card { margin: 0 auto; width: min(820px, 100%); flex: 0 1 auto; min-height: 0; overflow: auto; background: var(--pd-glass); border-radius: 18px; border-top: 5px solid #7c3aed; padding: 10px 16px 14px; box-shadow: 0 10px 28px rgba(30, 15, 0, .45); }
.pd-taste-trail { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pd-taste-trail li { display: flex; flex-direction: column; align-items: center; min-width: 76px; padding: 2px 10px 4px; border-radius: 11px; border: 2px dashed #d6cbb5; background: #fff; }
.pd-taste-trail li small { font-size: .66rem; font-weight: 800; color: var(--pd-muted); }
.pd-taste-trail li b { color: #a8a29e; font-size: 1rem; }
.pd-taste-trail li.is-done { border-style: solid; border-color: #16a34a; background: #f0fdf4; }
.pd-taste-trail li.is-done b { color: #14532d; }
.pd-taste-trail li.is-current { border-color: #7c3aed; box-shadow: 0 0 0 3px #ede9fe; }
.pd-taste-q { margin: 12px 0 8px; text-align: center; font-weight: 900; color: #3b2a4f; font-size: calc(1.02rem * var(--pf-tscale, 1)); }
.pd-taste-opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pd-taste-opt { --c: #7c3aed; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 96px; min-height: 52px; padding: 4px 14px; border-radius: 13px; border: 2px solid color-mix(in srgb, var(--c) 50%, #fff); background: #fff; color: var(--c); font-weight: 800; font-size: calc(.92rem * var(--pf-tscale, 1)); cursor: pointer; transition: transform .12s ease; }
.pd-taste-opt i { font-size: 1rem; }
.pd-taste-opt small { font-size: .68em; color: var(--pd-muted); font-weight: 700; }
.pd-taste-opt:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--c) 7%, #fff); }
.pd-taste-opt.is-wrong { opacity: .45; border-color: #dc2626; animation: pd-shake .35s ease; }
.pd-taste-card .pd-hint { margin-top: 10px; }

/* สรุป */
.pd-result { width: min(640px, 100%); padding: 18px 22px 18px; text-align: center; }
.pd-result h2 { margin: 4px 0; color: #5b2c06; font-size: calc(1.35rem * var(--pf-tscale, 1)); }
.pd-result-badge { width: 60px; height: 60px; margin: 0 auto 4px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f7c177, #b45309); color: #fff; font-size: 1.6rem; box-shadow: 0 0 0 5px #fde68a; }
.pd-unlock { display: inline-flex; gap: 8px; align-items: center; padding: 5px 14px; border-radius: 999px; background: #dcfce7; color: #15803d; font-weight: 800; font-size: .86rem; animation: pd-pop .4s ease; }
.pd-result-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; text-align: left; }
.pd-result-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 3px 10px; border-radius: 10px; background: #fff; }
.pd-result-list li b { font-size: 1.3rem; color: #3b1d05; }
.pd-result-list li span { font-size: .8rem; color: var(--pd-muted); }

/* ───────── ภาพเคลื่อนไหว ───────── */
@keyframes pd-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes pd-fizz { from { background-position: 0 0; } to { background-position: 0 -40px; } }
@keyframes pd-pulse { 0%, 100% { transform: scale(1); box-shadow: 0 6px 14px rgba(0, 0, 0, .4), 0 0 0 0 rgba(251, 191, 36, .6); } 50% { transform: scale(1.06); box-shadow: 0 6px 14px rgba(0, 0, 0, .4), 0 0 0 10px rgba(251, 191, 36, 0); } }
@keyframes pd-rumble { 0% { transform: translate(0, 0) rotate(-1deg); } 50% { transform: translate(1px, 1px) rotate(1deg); } 100% { transform: translate(0, 0) rotate(-1deg); } }
@keyframes pd-pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pd-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes pd-steam { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-150px) scale(1.8); opacity: 0; } }
@keyframes pd-smoke { 0% { transform: translate(-50%, 0) scale(.6); opacity: .9; } 100% { transform: translate(-50%, -60px) scale(1.6); opacity: 0; } }
@keyframes pd-rise { from { transform: translateY(24px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pd-star { from { transform: scale(0) rotate(-90deg); } to { transform: none; } }
@keyframes pd-glowbtn { 0%, 100% { box-shadow: 0 3px 0 #7c2d12, 0 0 0 0 rgba(251, 146, 60, .55); } 50% { box-shadow: 0 3px 0 #7c2d12, 0 0 0 9px rgba(251, 146, 60, 0); } }
@keyframes pd-drop { from { transform: translateY(-160px) rotate(calc(var(--rot, 0deg) * 4)); opacity: 0; } 70% { opacity: 1; } }
@keyframes pd-float { from { transform: translateY(var(--dy, 0)) rotate(var(--rot, 0deg)); } to { transform: translateY(calc(var(--dy, 0px) - 6px)) rotate(calc(var(--rot, 0deg) * -.5)); } }
@keyframes pd-swirl { to { transform: rotate(540deg) scale(.15); opacity: 0; } }
@keyframes pd-vortex { to { transform: rotate(320deg) scale(.4); } }
@keyframes pd-brewhue { from { filter: hue-rotate(0deg) brightness(1.1); } to { filter: hue-rotate(360deg) brightness(1.1); } }
@keyframes pd-bubble { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-160px) scale(1.2); opacity: 0; } }
@keyframes pd-ping { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pd-flash { from { transform: scale(.4); opacity: 1; } to { transform: scale(16); opacity: 0; } }
@keyframes pd-glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18) saturate(1.2); } }
@media (prefers-reduced-motion: reduce) {
	.pd-app *, .pd-app *::before, .pd-app *::after { animation: none !important; transition: none !important; }
	.pd-steps li { opacity: 1; transform: none; }
}

/* ───────── จอเตี้ย (มือถือแนวนอน) ───────── */
@media (max-height: 500px) {
	.pd-brew { gap: 5px; padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
	.pd-order { padding: 3px 14px 5px; }
	.pd-order-title { display: none; }
	.pd-order-gloss { font-size: calc(1.08rem * var(--pf-tscale, 1)); line-height: 1.4; }
	.pd-order-meta { font-size: calc(.66rem * var(--pf-tscale, 1)); }
	.pd-cue { font-size: calc(.7rem * var(--pf-tscale, 1)); padding: 0 9px; }
	.pd-flask { width: 30px; height: 34px; }
	.pd-flask::before { width: 10px; height: 10px; }
	.pd-flask::after { height: 25px; }
	.pd-flask-liquid { max-height: 20px; }
	.pd-node + .pd-node::before { top: 17px; height: 4px; }
	.pd-node.is-done .pd-node-btn::after { top: 6px; right: calc(50% - 22px); width: 15px; height: 15px; }
	.pd-node-text small { font-size: calc(.58rem * var(--pf-tscale, 1)); }
	.pd-node-val { font-size: calc(.74rem * var(--pf-tscale, 1)); }
	.pd-still-icon { width: 34px; height: 34px; font-size: .9rem; }
	/* จอเตี้ย: โต๊ะสำคัญกว่า — หม้อย่อเหลือแถบเล็ก ชิปในหม้อเล็กลง */
	.pd-pot-wrap { min-height: 64px; }
	.pd-pot-empty small { display: none; }
	.pd-pot .pd-pot-chip { font-size: calc(.95rem * var(--pf-tscale, 1)); padding: 0 8px; }
	.pd-pot-chips { top: 22%; bottom: 6%; gap: 4px 6px; }
	.pd-pot-word { font-size: calc(1.6rem * var(--pf-tscale, 1)); top: 26%; }
	.pd-bench { max-height: 76%; }
	.pd-gana-cue { display: flex; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 10px; font-size: calc(.74rem * var(--pf-tscale, 1)) !important; }
	.pd-bottle.is-dhatu { min-height: 52px; }
	.pd-bottle.is-dhatu .pd-pali { font-size: 1.3em; }
	.pd-shelf { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding: 3px 0 2px; }
	.pd-shelf-label { min-width: 0; max-width: 64px; font-size: calc(.64rem * var(--pf-tscale, 1)); line-height: 1.25; }
	.pd-bottle { flex: none; }
	.pd-bottle small { font-size: calc(.54rem * var(--pf-tscale, 1)); }
	.pd-slot { min-width: 54px; padding: 0 8px 1px; }
	.pd-slot b { font-size: calc(.95rem * var(--pf-tscale, 1)); min-height: 1.25em; }
	.pd-bench-actions { bottom: -8px; margin: auto -11px -8px; padding: 6px 11px 8px; }
	.pd-drawer-cats { flex-wrap: nowrap; overflow-x: auto; }
	.pd-drawer-cats .pd-drawer-btn { flex: none; min-height: 34px; justify-content: center; }
	.pd-drawer-cats .pd-drawer-btn small { display: none; }
	.pd-bench { padding: 6px 11px 8px; gap: 5px; border-radius: 14px; }
	.pd-bench-head { display: flex; align-items: baseline; gap: 10px; }
	.pd-bench-head h2 { font-size: calc(.86rem * var(--pf-tscale, 1)); white-space: nowrap; }
	.pd-bench-head p { font-size: calc(.7rem * var(--pf-tscale, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.pd-flask-sm { display: none; }
	.pd-bottle { min-height: 40px; padding: 1px 9px; }
	.pd-vacaka-btn { min-height: 50px; padding: 3px; }
	.pd-vacaka-btn small { display: none; }
	.pd-btn-main, .pd-btn-ghost { min-height: 40px; padding: 0 13px; }
	.pd-drawer { padding: 5px 6px; gap: 4px; }
	.pd-drawer-btn { min-height: 38px; padding: 1px 7px; }
	.pd-drawer-open { min-height: 40px; padding: 3px 8px; }
	.pd-drawer-ending { font-size: calc(1.5rem * var(--pf-tscale, 1)); }
	.pd-home-body { justify-content: flex-start; padding-top: calc(70px + env(safe-area-inset-top, 0px)); gap: 7px; }
	.pd-home h1 { font-size: calc(2.2rem * var(--pf-tscale, 1)); }
	.pd-home-say { font-size: calc(.82rem * var(--pf-tscale, 1)); line-height: 1.6; }
	.pd-mode { min-height: 52px; padding: 6px 11px; }
	.pd-potion strong { font-size: calc(1.6rem * var(--pf-tscale, 1)); }
	.pd-taste-word { font-size: calc(1.6rem * var(--pf-tscale, 1)) !important; }
	.pd-tabs { top: 58px; }
}
/* ───────── จอแคบ ───────── */
@media (max-width: 720px) {
	.pd-order { width: calc(100% - 64px); margin-left: 56px; }
	.pd-vacaka-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.pd-node-text small { display: none; }
	/* หน้าปกมือถือ: ภาพอยู่บน ข้อความเลื่อนต่อด้านล่าง */
	.pd-home-art { bottom: auto; height: 50vh; background-position: 72% 50%; }
	.pd-home-art::after { background: linear-gradient(0deg, #1c1004 0%, rgba(28, 16, 4, .6) 26%, rgba(28, 16, 4, 0) 55%); }
	.pd-home-body { justify-content: flex-start; padding: calc(38vh + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px)); gap: 9px; }
	.pd-home-modes { grid-template-columns: 1fr; }
	.pd-home-stats li { flex: 1 1 0; min-width: 0; padding: 6px 10px; }
	.pd-vibtable { grid-template-columns: 1fr; }
	.pd-steps li { grid-template-columns: 1fr; gap: 0; }
	.pd-shelf-label { width: 100%; }
}

/* แถบสถานะซิงก์บนหน้าปก */
.pd-sync { display: flex; align-items: center; gap: 7px; margin: 10px 0 0; padding: 7px 11px; border-radius: 10px;
	background: rgba(255, 250, 240, .7); border: 1px solid rgba(107, 90, 69, .18); color: var(--pd-muted);
	font-size: calc(.8rem * var(--pf-tscale, 1)); font-weight: 700; line-height: 1.6; }
.pd-sync a { color: #b45309; text-decoration: underline; text-underline-offset: 2px; }
.pd-sync.is-saved { color: #047857; border-color: rgba(4, 120, 87, .28); background: rgba(236, 253, 245, .8); }
.pd-sync.is-error, .pd-sync.is-unverified { color: #b45309; border-color: rgba(180, 83, 9, .3); background: rgba(255, 247, 237, .85); }
