/* วงก์เสียงสะท้อน + แสตมป์คอลเลกชัน (ใบ echo-spiral-p1-1029 · client/spiral-gate.js · client/belfry.js drawSpiral · client/cstamp-ui.js)
   ขนาดตัวหนังสือ/ปุ่มใช้กฎกลาง ui-scale.css (var(--fs-*) · --btn-h) — ห้ามใส่ px ตรง ๆ ที่ font-size */

/* การ์ดเลือก 2 ดัน (หัวหน้าต่างประตู) */
.bfx-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 10px 4px; }
.bfx-mode { display: flex; align-items: center; gap: 10px; min-height: var(--btn-h, 44px); padding: 8px 10px; border-radius: 12px; border: 2px solid #d9c9a3;
  background: linear-gradient(180deg, #fffaf0, #f3e7cc); color: #4a3a22; text-align: left; cursor: pointer; }
.bfx-mode.on { border-color: #2f6f73; background: linear-gradient(180deg, #eaf6f2, #cfe8e1); box-shadow: 0 0 0 2px rgba(47, 111, 115, .25); }
.bfx-mode[data-bfmode="spiral"].on { border-color: #3a5a9c; background: linear-gradient(180deg, #eef1fb, #d6def4); box-shadow: 0 0 0 2px rgba(58, 90, 156, .25); }
.bfx-mi { flex: none; width: 34px; height: 34px; display: grid; place-items: center; font-size: var(--fs-name, 18px); }
.bfx-mt { display: grid; gap: 1px; min-width: 0; }
.bfx-mt b { font-size: var(--fs-body, 16px); }
.bfx-mt small { font-size: var(--fs-xs, 12px); opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bfm-side .bfx-modes { grid-template-columns: 1fr; padding: 6px 0; }
.bfm-side .bfx-mt small + small { display: none; }

/* หน้าวงก์ — กล่องเลื่อนของตัวเอง (ไม่ใช้ .bfe-scroll/.bfm-scroll ของหอระฆัง ที่จัดเป็นคอลัมน์ของหน้านั้น) */
.sp-on .sp-scroll { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.bfe.sp-on { display: flex; flex-direction: column; max-height: min(78vh, 760px); }
.bfm.sp-on .bfm-main { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.bfm.sp-on .bfm-act { margin-top: auto; }
.spw { display: block; padding: 6px 10px 10px; }   /* ไม่ใช้ชื่อ .sp — ui-npc-trade.css มี #windows .sp (ร้านค้า) */
.spw > * + * { margin-top: 8px; }
.sp-story { margin: 0; font-size: var(--fs-sm, 14px); color: #5a4a30; line-height: 1.45; }
.spx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; align-items: start; }
.spx-card { display: block; padding: 10px 12px; border-radius: 12px; background: #fffaf0; border: 1px solid #e3d3ad; box-shadow: 0 1px 0 rgba(120, 90, 40, .12); color: #4a3a22; min-width: 0; }
.spx-h { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: var(--fs-body, 16px); color: #3a5a9c; }
.spx-h > span { flex: 1 1 auto; min-width: 0; }
.spx-more { margin-left: auto; min-height: var(--btn-h, 44px); padding: 0 10px; border-radius: 10px; border: 1px solid #c9d3ec; background: #fff; color: #3a5a9c; font-size: var(--fs-xs, 12px); cursor: pointer; }
.spx-req { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.spx-req li { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm, 14px); }
.spx-req li i { font-style: normal; font-weight: 700; color: #2f8a4a; }
.spx-req li.no i { color: #c0503a; }
.spx-fix { margin-left: auto; min-height: var(--btn-h, 44px); padding: 0 10px; border-radius: 10px; border: 1px solid #2f6f73; background: #eaf6f2; color: #2f6f73; font-size: var(--fs-xs, 12px); cursor: pointer; }
.sp-dots { display: flex; gap: 5px; margin: 4px 0; }
.sp-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #3a5a9c; background: #fff; }
.sp-dots i.boss { border-radius: 4px; border-color: #b8862f; }
.sp-dots i.on { background: #3a5a9c; }
.sp-dots i.boss.on { background: #e8b64a; }
.sp-fl, .sp-boss, .sp-lv, .sp-mentor { margin: 2px 0; font-size: var(--fs-sm, 14px); }
.sp-lv { opacity: .75; font-size: var(--fs-xs, 12px); }
.sp-rw { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 4px; }
.sp-rw li { display: flex; gap: 6px; align-items: baseline; font-size: var(--fs-sm, 14px); }
.sp-rw li i { font-style: normal; color: #3a5a9c; font-weight: 700; }
.sp-rw li.done { opacity: .6; }
.sp-rw li.done i { color: #2f8a4a; }
.sp-badge { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed #d9c9a3; font-size: var(--fs-sm, 14px); }
.sp-badge small { opacity: .7; font-size: var(--fs-xs, 12px); }
.sp-badge .rbtn { min-height: var(--btn-h, 44px); }
.bfh-spn { opacity: .7; font-size: var(--fs-xs, 12px); }

/* พรีวิวแสตมป์วงก์ */
.spv { display: grid; gap: 8px; }
.spv-head, .spv-rates, .spv-rule { margin: 0; font-size: var(--fs-sm, 14px); }
.spv-rule { opacity: .8; font-size: var(--fs-xs, 12px); }
.spv-set h6 { margin: 4px 0; font-size: var(--fs-body, 16px); color: #3a5a9c; }
.spv-set h6 small { color: #7a6a4a; font-weight: 400; font-size: var(--fs-xs, 12px); }
.spv-set ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px; }
.spv-set li { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 10px; background: rgba(58, 90, 156, .06); }
.spv-tx { display: grid; gap: 1px; min-width: 0; }
.spv-tx b { font-size: var(--fs-sm, 14px); }
.spv-tx small { font-size: var(--fs-xs, 12px); opacity: .85; }
.spv-tx .spv-r { color: #3a5a9c; opacity: 1; }
.spv-heart { font-style: normal; color: #b8862f; font-size: var(--fs-xs, 12px); }
.spv-bonus { margin: 4px 0 0; font-size: var(--fs-xs, 12px); color: #5a4a30; }
.spv-el summary { cursor: pointer; font-size: var(--fs-sm, 14px); min-height: var(--btn-h, 44px); display: flex; align-items: center; }
.spv-el ul { margin: 0; padding-left: 18px; font-size: var(--fs-xs, 12px); }

/* ชิ้นแสตมป์คอลเลกชัน (ภาพจริงทับไอคอนตัวอักษร · กรอบสีคอลเลกชัน + ขอบสี Rank) */
.cst { position: relative; flex: none; display: inline-grid; place-items: center; border-radius: 10px; background: var(--cst-bg);
  box-shadow: inset 0 0 0 3px var(--cst-rim), 0 0 0 2px var(--cst-rk); overflow: hidden; color: #fff8e6; }
.cst-s { width: 40px; height: 60px; }
.cst-m { width: 64px; height: 96px; }
.cst-l { width: 128px; height: 192px; }
/* มีภาพจริง (assets/ui/cstamp/<id>.webp · กรอบแสตมป์ในภาพ 240×360) — ไม่วาดกล่องสี · ขอบสี Rank เป็นเงาตามรูปแสตมป์ */
.cst.art { background: none; box-shadow: none; border-radius: 0; overflow: visible; }
.cst.art img { object-fit: contain; filter: drop-shadow(0 0 1.5px var(--cst-rk)) drop-shadow(0 0 1px var(--cst-rk)); }
.cst.art .g { visibility: hidden; }
.cst.art .rk { right: 1px; bottom: 1px; line-height: 1.15; padding: 0 3px; border-radius: 6px; background: var(--cst-rk); color: #fff; text-shadow: none; }
.cst .g { font-style: normal; font-size: var(--fs-title, 20px); line-height: 1; }
.cst-l .g { font-size: var(--fs-hero, 24px); }
.cst img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cst .rk { position: absolute; right: 2px; bottom: 1px; font-size: var(--fs-xs, 12px); color: var(--cst-rk); text-shadow: 0 1px 0 #000a; }
.cst .hs { position: absolute; left: 3px; top: 1px; font-style: normal; font-size: var(--fs-xs, 12px); color: #ffd76a; }
.cst.c-event { color: #5a3a2a; }
.cst.sleep { filter: grayscale(.7) brightness(.85); }

/* แถวพิเศษ (หน้าแปะ) + ป๊อปอัปเลือกชุด */
.cst-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.cst-cell { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; min-height: 96px; border-radius: 10px; border: 2px dashed #9fb0d8; background: rgba(58, 90, 156, .05); cursor: pointer; font-size: var(--fs-xs, 12px); text-align: center; }
.cst-cell.full { border-style: solid; border-color: #3a5a9c; }
.cst-cell.lock { opacity: .6; cursor: default; }
.cst-cell b { font-size: var(--fs-xs, 12px); }
.cst-sets { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cst-sets em { font-style: normal; padding: 2px 6px; border-radius: 8px; background: #3a5a9c; color: #fff; font-size: var(--fs-xs, 12px); }
.cst-pick { position: fixed; inset: 0; z-index: var(--z-popup, 300); display: grid; place-items: center; background: rgba(20, 24, 40, .45); }
.cst-pick > div { width: min(94vw, 560px); max-height: 90vh; overflow: auto; padding: 14px; border-radius: 16px; background: #fffaf0; border: 3px solid #3a5a9c; display: grid; gap: 8px; }
.cst-pick h4 { margin: 0; font-size: var(--fs-name, 18px); color: #3a5a9c; }
.cst-pick p { margin: 0; font-size: var(--fs-sm, 14px); }
.cst-pick .opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cst-pick .opts button { display: grid; gap: 4px; justify-items: center; min-height: 96px; padding: 8px; border-radius: 12px; border: 2px solid #9fb0d8; background: #fff; cursor: pointer; font-size: var(--fs-sm, 14px); }
.cst-pick .opts button small { font-size: var(--fs-xs, 12px); opacity: .8; }
.cst-pick header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cst-pick .x { flex: none; min-height: var(--btn-h, 44px); min-width: 88px; }
.cst-pick > div { max-height: calc(100dvh - 16px); }
@media (max-height: 500px) {   /* มือถือแนวนอน: 4 ชุดเรียงแถวเดียว ปุ่มเลือกอยู่ในจอแรก */
  .cst-pick .opts { grid-template-columns: repeat(4, 1fr); }
  .cst-pick .opts button { min-height: 72px; padding: 6px; }
  .cst-pick .opts button small { display: none; }
}
.cst-pick details summary { min-height: var(--btn-h, 44px); display: flex; align-items: center; cursor: pointer; font-size: var(--fs-sm, 14px); }
.cst-wrap { margin-top: 8px; padding: 8px; border-radius: 12px; background: rgba(58, 90, 156, .07); border: 1px solid rgba(58, 90, 156, .25); }
.cst-wrap h5 { margin: 0 0 4px; font-size: var(--fs-sm, 14px); color: #3a5a9c; }
.cst-bagrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cst-bag { display: grid; place-items: center; min-width: 48px; min-height: 58px; padding: 2px; border-radius: 10px; border: 2px solid transparent; background: #fff; cursor: pointer; font-size: var(--fs-name, 18px); }
.cst-bag.on { border-color: #e8b64a; }
.cst-bag small { font-size: var(--fs-xs, 12px); }
.cst-fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: var(--fs-xs, 12px); }
.cst-fbar .rbtn, .cst-fgo { min-height: var(--btn-h, 44px); }
.cst-none { margin: 6px 0 0; font-size: var(--fs-xs, 12px); opacity: .8; }
.cst-coll { display: grid; gap: 8px; padding: 8px; }
.cst-coll h5 { margin: 0; font-size: var(--fs-body, 16px); color: #3a5a9c; }
.cst-cl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px; }
.cst-cl li { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 10px; background: rgba(58, 90, 156, .06); }
.cst.norank .rk { display: none; }

/* ── ใบ echo-spiral-p2-1029: 6 โซน · แท็บกระดานผู้พิชิต · "มีโอกาสได้อะไร" · ซอง 4 สี ── */
.sp-tabs { display: flex; gap: 6px; }
.sp-tab { flex: 1 1 0; min-height: var(--btn-h, 44px); border-radius: 12px; border: 2px solid #c9d3ec; background: #fff; color: #3a5a9c; font-weight: 700; font-size: var(--fs-sm, 14px); cursor: pointer; }
.sp-tab.on { background: #3a5a9c; border-color: #3a5a9c; color: #fff; }
.sp-prog.z-sand { background: linear-gradient(180deg, #fff6e2, #fbe9c4); }
.sp-prog.z-forest { background: linear-gradient(180deg, #f2f8ea, #dcedc9); }
.sp-prog.z-sea { background: linear-gradient(180deg, #eef7fb, #d2eaf3); }
.sp-chance-h { margin: 0 0 4px; font-size: var(--fs-sm, 14px); color: #5a4a30; }
.sp-chance { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.sp-chance li { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm, 14px); line-height: 1.3; }
.sp-chance li .ic { flex: none; width: 24px; display: grid; place-items: center; }
.sp-chance li.envs { flex-wrap: wrap; }
.cst-env { position: relative; flex: none; display: inline-grid; place-items: center; width: 30px; height: 36px; border-radius: 6px; background: var(--cst-bg); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.cst-env i { font-style: normal; font-size: var(--fs-sm, 14px); }
.cst-env.art { background: none; box-shadow: none; }
.cst-env.art i { visibility: hidden; }
.cst-env img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cst-env-m { width: 48px; height: 58px; }
.spv-set h6 { display: flex; align-items: center; gap: 8px; }
.spv-set.s-flame h6 { color: #b4541e; }
.spv-set.s-bell h6 { color: #9a7420; }
.spv-set.s-breeze h6 { color: #3f7a48; }
.spv-set.s-wonder h6 { color: #6a44a8; }
.spv-set.s-flame li { background: rgba(224, 122, 58, .08); }
.spv-set.s-bell li { background: rgba(217, 168, 58, .1); }
.spv-set.s-breeze li { background: rgba(95, 168, 106, .1); }
.spv-set.s-wonder li { background: rgba(138, 90, 208, .09); }
.spv-who { margin: 0; padding: 4px 10px; border-radius: 10px; background: #e9eef8; color: #3a5a9c; font-weight: 700; font-size: var(--fs-sm, 14px); }
.bfh-st small { font-weight: 400; opacity: .75; font-size: var(--fs-xs, 12px); }
/* ป้ายชั้นวงก์ (belfry.js floorTag) — กลางบนใต้แถบดัน หายเอง ไม่รับคลิก */
.bf-floor { position: fixed; left: 50%; top: calc(var(--sa-t, 0px) + 30%); transform: translateX(-50%); z-index: var(--z-hud, 100); pointer-events: none; display: grid; justify-items: center; gap: 2px; padding: 8px 22px; border-radius: 14px; background: linear-gradient(180deg, rgba(36, 48, 92, .88), rgba(28, 36, 72, .88)); border: 2px solid #e8c46a; color: #fff6dc; text-shadow: 0 1px 0 #1a2040; }
.bf-floor b { font-size: var(--fs-title, 20px); }
.bf-floor small { font-size: var(--fs-xs, 12px); opacity: .85; }
.bf-floor.on { animation: bf-floor-in .9s ease-out; }
@keyframes bf-floor-in { 0% { opacity: 0; transform: translate(-50%, -8px) scale(.9); } 25% { opacity: 1; transform: translate(-50%, 0) scale(1.04); } 100% { opacity: 1; transform: translate(-50%, 0) scale(1); } }

/* ══ หน้าประตูวงก์ออกแบบใหม่ (ใบ echo-spiral-p2-1029 · ผู้ใช้ 29 ต.ค.) — ทุกกฎอยู่ใต้ .esg (ราก) เท่านั้น ══
   ลำดับ: ภาพหัว+สลับดัน+แท็บ → การ์ดภาพโซน → ปุ่มเริ่มใหญ่ → รางวัล → เงื่อนไขที่ขาด · มือถือ 844×390 พอดีจอ ไม่ต้องเลื่อน */
.bfe.esg-on { display: flex; flex-direction: column; height: 100%; min-height: 0; }
#windows .esg { --esg-ink: #3e2a14; --esg-mute: #7a6548; --esg-gold: #e8b64a; --esg-teal: #2f6f73; --esg-navy: #2e3f78; --esg-line: #e6d3a8;
  display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--esg-ink); }
#windows .esg .esg-hero { position: relative; flex: none; display: flex; align-items: flex-end; gap: 10px; min-height: 96px; padding: 10px 64px 10px 14px; overflow: hidden;
  border-radius: 14px 14px 0 0; background: linear-gradient(120deg, #24305e, #3a4c8c); }
#windows .esg .esg-bn { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
#windows .esg .esg-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 24, 52, .78) 0%, rgba(20, 24, 52, .35) 45%, rgba(20, 24, 52, 0) 70%), linear-gradient(0deg, rgba(20, 24, 52, .45), rgba(20, 24, 52, 0) 55%); pointer-events: none; }
#windows .esg .esg-hero > :not(.esg-bn) { position: relative; z-index: 1; }
#windows .esg .esg-ht { display: grid; gap: 2px; margin-right: auto; color: #fff6dc; text-shadow: 0 2px 4px rgba(10, 12, 30, .6); }
#windows .esg .esg-ht b { font-size: var(--fs-hero, 24px); line-height: 1.15; }
#windows .esg .esg-ht small { font-size: var(--fs-sm, 14px); opacity: .92; }
#windows .esg .esg-sw, #windows .esg .esg-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(255, 248, 230, .18); backdrop-filter: blur(2px); }
#windows .esg .esg-pill, #windows .esg .esg-tab { display: inline-flex; align-items: center; gap: 4px; min-height: var(--btn-h, 44px); padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: #fff6dc; font-weight: 700; font-size: var(--fs-sm, 14px); cursor: pointer; }
#windows .esg .esg-pill .ui-ic { width: 20px; height: 20px; }
#windows .esg .esg-pill.on, #windows .esg .esg-tab.on { background: linear-gradient(180deg, #fbe7b0, var(--esg-gold)); color: #4a2f0c; box-shadow: 0 2px 0 #a8792a; }
#windows .esg .esg-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 12px; background: #fff8ea; border-radius: 0 0 14px 14px; }
/* การ์ดภาพโซน */
#windows .esg .esg-zones { flex: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
#windows .esg .esg-z { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 0; min-height: 112px; padding: 8px 10px 10px; overflow: hidden;
  border-radius: 14px; border: 3px solid #f2e2bd; background: #6b7aa8; color: #fff; text-align: left; cursor: pointer; box-shadow: 0 2px 0 rgba(120, 90, 40, .25); }
#windows .esg .esg-z img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#windows .esg .esg-z::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(14, 16, 34, .82) 0%, rgba(14, 16, 34, .25) 55%, rgba(14, 16, 34, 0) 75%); }
#windows .esg .esg-z > :not(img) { position: relative; z-index: 1; }
#windows .esg .esg-z b { font-size: var(--fs-name, 18px); line-height: 1.15; text-shadow: 0 1px 3px #000a; }
#windows .esg .esg-z small, #windows .esg .esg-zf { font-size: var(--fs-xs, 12px); text-shadow: 0 1px 2px #000a; }
#windows .esg .esg-z > .esg-zf { position: absolute; top: 6px; left: 6px; padding: 1px 8px; border-radius: 999px; background: rgba(20, 24, 52, .7); }
#windows .esg .esg-zp { display: block; width: 100%; height: 6px; margin-top: 5px; border-radius: 4px; background: rgba(255, 255, 255, .3); overflow: hidden; }
#windows .esg .esg-zp > i { display: block; height: 100%; background: linear-gradient(90deg, #ffe08a, var(--esg-gold)); }
#windows .esg .esg-z.on { border-color: var(--esg-gold); box-shadow: 0 0 0 3px rgba(232, 182, 74, .45), 0 4px 10px rgba(80, 50, 10, .3); transform: translateY(-2px); }
#windows .esg .esg-z.locked { filter: grayscale(.85) brightness(.8); cursor: default; }
#windows .esg .esg-z.low { filter: saturate(.6); }
/* แถวล่าง: ข้อมูลโซน (บอส + รางวัล) | ปุ่มเริ่ม */
#windows .esg .esg-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 10px; align-items: stretch; }
#windows .esg .esg-card { padding: 10px 12px; border-radius: 14px; background: #fffdf6; border: 2px solid var(--esg-line); box-shadow: 0 2px 0 rgba(120, 90, 40, .12); min-width: 0; }
#windows .esg .esg-h { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; font-size: var(--fs-body, 16px); color: var(--esg-teal); }
#windows .esg .esg-h img, #windows .esg .esg-h .ui-ic { width: 22px; height: 22px; object-fit: contain; }
#windows .esg .esg-link { margin-left: auto; min-height: var(--btn-h, 44px); padding: 0 12px; border: 0; border-radius: 999px; background: #eef5f3; color: var(--esg-teal); font-weight: 700; font-size: var(--fs-sm, 14px); cursor: pointer; }
#windows .esg .esg-bosses { display: flex; gap: 10px; flex-wrap: wrap; }
#windows .esg .esg-bs { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
#windows .esg .esg-bs img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #2e3f78; border: 2px solid var(--esg-gold); filter: hue-rotate(195deg) saturate(.85); }
#windows .esg .esg-bs span { display: grid; min-width: 0; }
#windows .esg .esg-bs b { font-size: var(--fs-sm, 14px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#windows .esg .esg-bs small { font-size: var(--fs-xs, 12px); color: var(--esg-mute); }
#windows .esg .esg-rw { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
#windows .esg .esg-rw li { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 6px; align-items: center; padding: 4px 10px 4px 4px; border-radius: 12px; background: #fbf1da; min-height: 44px; }
#windows .esg .esg-rw li .ic { grid-row: 1 / 3; display: inline-flex; gap: 2px; align-items: center; }
#windows .esg .esg-rw li .ic > img, #windows .esg .esg-rw li .ic .ui-ic, #windows .esg .esg-rw li .ic > :is(img, svg, span:not(.cst-env)) { width: 32px; height: 32px; object-fit: contain; }
#windows .esg .esg-rw li b { font-size: var(--fs-sm, 14px); line-height: 1.1; }
#windows .esg .esg-rw li small { font-size: var(--fs-xs, 12px); color: var(--esg-mute); line-height: 1.1; }
#windows .esg .esg-rw li.envs .cst-env { width: 26px; height: 36px; }
#windows .esg .esg-rw li[data-icard] { cursor: pointer; }
#windows .esg .esg-start { display: flex; flex-direction: column; justify-content: center; gap: 8px; background: linear-gradient(180deg, #fffdf6, #fbefd2); }
#windows .esg .esg-prog { margin: 0; font-size: var(--fs-sm, 14px); color: var(--esg-mute); text-align: center; }
#windows .esg .esg-go { display: grid; justify-items: center; gap: 0; min-height: var(--btn-h-main, 52px); padding: 6px 12px; border: 0; border-radius: 16px; cursor: pointer;
  background: linear-gradient(180deg, #6fc46a, #3f9a46); color: #fff; box-shadow: 0 4px 0 #2b6e31; font-weight: 800; text-shadow: 0 1px 0 #1e5a24; }
#windows .esg .esg-go span { font-size: var(--fs-btn-main, 18px); }
#windows .esg .esg-go small { font-size: var(--fs-xs, 12px); font-weight: 600; opacity: .92; }
#windows .esg .esg-go:disabled { background: #d8ceb8; box-shadow: 0 3px 0 #b4a888; color: #6e6250; text-shadow: none; cursor: default; font-size: var(--fs-body, 16px); }
#windows .esg .esg-miss { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
#windows .esg .esg-miss li { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm, 14px); }
#windows .esg .esg-miss li > i { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #e98a5a; color: #fff; font-style: normal; font-weight: 800; font-size: var(--fs-xs, 12px); }
#windows .esg .esg-fix { margin-left: auto; min-height: var(--btn-h, 44px); padding: 0 12px; border: 0; border-radius: 999px; background: var(--esg-teal); color: #fff; font-weight: 700; font-size: var(--fs-sm, 14px); cursor: pointer; }
#windows .esg .esg-badge { min-height: var(--btn-h, 44px); border: 2px dashed var(--esg-line); border-radius: 12px; background: #fffaf0; color: var(--esg-mute); font-size: var(--fs-sm, 14px); cursor: pointer; }
#windows .esg .esg-mentor { margin: 0; font-size: var(--fs-sm, 14px); }
#windows .esg .esg-prevh { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
#windows .esg .esg-prevh b { font-size: var(--fs-body, 16px); color: var(--esg-teal); }
/* จอสัมผัส/แนวนอนเตี้ย (844×390 · 667×375): หัวเตี้ยลง · การ์ดโซนเลื่อนแนวนอน · ไม่มีเงาลอย */
html.touch-ui #windows .esg .esg-hero { min-height: 58px; padding: 6px 60px 6px 12px; align-items: center; }
html.touch-ui #windows .esg .esg-ht b { font-size: var(--fs-title, 20px); }
html.touch-ui #windows .esg .esg-ht small { display: none; }
html.touch-ui #windows .esg .esg-body { gap: 8px; padding: 8px 10px 10px; }
html.touch-ui #windows .esg .esg-zones { display: flex; overflow-x: auto; scroll-snap-type: x proximity; }
html.touch-ui #windows .esg .esg-z { flex: 0 0 132px; min-height: 92px; scroll-snap-align: start; }
html.touch-ui #windows .esg .esg-z b { font-size: var(--fs-body, 16px); }
html.touch-ui #windows .esg .esg-main { grid-template-columns: minmax(0, 1fr) 220px; }
html.touch-ui #windows .esg .esg-bosses { display: none; }
@media (max-width: 700px) { html.touch-ui #windows .esg .esg-main { grid-template-columns: minmax(0, 1fr) 190px; } html.touch-ui .esg .esg-sw span { display: none; } }
/* หน้าต่างบนคอม: ขนาด L เดิม · เนื้อเต็มบาน */
.esg-win > .body { padding: 0; }
/* จอสัมผัส: รางวัลเป็นตาราง 3 ช่องแบบย่อ (ไอคอน + ตัวเลข) — พอดีจอ 844×390 ไม่ต้องเลื่อน · ชื่อเต็มอยู่ในพรีวิว/แตะไอคอน */
#windows .esg .esg-sw > .esg-pill, #windows .esg .esg-tabs > .esg-tab { min-height: 44px; height: 44px; max-height: none; }
html.touch-ui #windows .esg .esg-info { padding: 6px 10px; }
html.touch-ui #windows .esg .esg-h { margin: 0 0 4px; }
html.touch-ui #windows .esg .esg-rw { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
html.touch-ui #windows .esg .esg-rw li { min-height: 40px; padding: 2px 6px 2px 2px; grid-template-rows: auto; }
html.touch-ui #windows .esg .esg-rw li small { display: none; }
html.touch-ui #windows .esg .esg-rw li .ic > img, html.touch-ui #windows .esg .esg-rw li .ic .ui-ic, html.touch-ui #windows .esg .esg-rw li .ic > :is(img, svg, span:not(.cst-env)) { width: 26px; height: 26px; }
html.touch-ui #windows .esg .esg-rw li b { font-size: var(--fs-xs, 12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.touch-ui #windows .esg .esg-rw li.envs .cst-env { width: 18px; height: 26px; }
html.touch-ui #windows .esg .esg-start { padding: 6px 10px; gap: 4px; }
html.touch-ui #windows .esg .esg-rw li { align-items: center; }
html.touch-ui #windows .esg .esg-rw li b { grid-row: 1 / 3; }
html.touch-ui #windows .esg .esg-rw li.envs b { display: none; }
/* คอม: ภาพหัว/การ์ดโซนใหญ่ขึ้น · ตัวหนังสือรางวัล/บอสขนาดอ่านสบาย (ฐานหน้าต่างคอม 13px) */
html:not(.touch-ui) #windows .esg .esg-hero { min-height: 150px; }
html:not(.touch-ui) #windows .esg .esg-z { min-height: 150px; }
html:not(.touch-ui) #windows .esg .esg-z b { font-size: var(--fs-title, 20px); }
html:not(.touch-ui) #windows .esg .esg-z small, html:not(.touch-ui) #windows .esg .esg-z > .esg-zf { font-size: var(--fs-sm, 14px); }
html:not(.touch-ui) #windows .esg .esg-rw li b, html:not(.touch-ui) #windows .esg .esg-bs b { font-size: var(--fs-body, 16px); }
html:not(.touch-ui) #windows .esg .esg-rw li small, html:not(.touch-ui) #windows .esg .esg-bs small, html:not(.touch-ui) #windows .esg .esg-prog { font-size: var(--fs-sm, 14px); }
html:not(.touch-ui) #windows .esg .esg-rw li .ic > img, html:not(.touch-ui) #windows .esg .esg-rw li .ic .ui-ic, html:not(.touch-ui) #windows .esg .esg-rw li .ic > :is(img, svg, span:not(.cst-env)) { width: 40px; height: 40px; }
html:not(.touch-ui) #windows .esg .esg-rw li.envs .cst-env { width: 32px; height: 44px; }
html:not(.touch-ui) #windows .esg .esg-bs img { width: 56px; height: 56px; }
html:not(.touch-ui) #windows .esg .esg-prev :is(.spv-tx b, .spv-head, .spv-bonus) { font-size: var(--fs-sm, 14px); }
/* ── v3 (หัวหน้าตรวจ 29 ต.ค.): เลือกดัน = การ์ดสลับ 2 ใบมีภาพ · หน้า = แท็บเส้นใต้ใต้ภาพหัว · แผ่นแสตมป์การ์ดภาพใหญ่ ── */
#windows .esg .esg-sw { gap: 6px; padding: 4px; border-radius: 16px; background: rgba(20, 24, 52, .55); }
#windows .esg .esg-sw > .esg-seg { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 14px 4px 6px; border: 2px solid transparent; border-radius: 12px;
  background: transparent; color: #f3e8cc; text-align: left; cursor: pointer; }
#windows .esg .esg-seg img { width: 36px; height: 40px; object-fit: contain; flex: none; }
#windows .esg .esg-seg span { display: grid; line-height: 1.15; }
#windows .esg .esg-seg b { font-size: var(--fs-sm, 14px); }
#windows .esg .esg-seg small { font-size: var(--fs-xs, 12px); opacity: .85; }
#windows .esg .esg-sw > .esg-seg.on { background: linear-gradient(180deg, #fff6dc, #f5dc9c); border-color: var(--esg-gold); color: #4a2f0c; box-shadow: 0 2px 0 #a8792a; }
#windows .esg .esg-tabs { flex: none; display: flex; gap: 4px; padding: 0 12px; border-radius: 0; background: #fff8ea; backdrop-filter: none; border-bottom: 2px solid var(--esg-line); }
#windows .esg .esg-tabs > .esg-tab { position: relative; min-height: 44px; height: 44px; padding: 0 16px; border-radius: 0; background: none; box-shadow: none; color: var(--esg-mute); font-size: var(--fs-body, 16px); font-weight: 700; }
#windows .esg .esg-tabs > .esg-tab.on { background: none; color: var(--esg-teal); box-shadow: none; }
#windows .esg .esg-tabs > .esg-tab.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -2px; height: 4px; border-radius: 3px; background: var(--esg-teal); }
#windows .esg .esg-body { border-radius: 0 0 14px 14px; }
html.touch-ui #windows .esg .esg-ht small { display: block; font-size: var(--fs-xs, 12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
html.touch-ui #windows .esg .esg-hero { min-height: 62px; }
html.touch-ui #windows .esg .esg-sw > .esg-seg { min-height: 46px; padding: 2px 10px 2px 4px; }
html.touch-ui #windows .esg .esg-seg img { width: 28px; height: 32px; }
html.touch-ui #windows .esg .esg-seg small { display: none; }
html.touch-ui #windows .esg .esg-tabs > .esg-tab { font-size: var(--fs-sm, 14px); }
@media (max-width: 700px) { html.touch-ui #windows .esg .esg-seg b { font-size: var(--fs-xs, 12px); } html.touch-ui #windows .esg .esg-ht small { display: none; } }
html:not(.touch-ui) #windows .esg .esg-info .esg-link { display: inline-flex; align-items: center; }
/* แผ่นแสตมป์ */
#windows .esg .esg-sheet { display: grid; gap: 10px; }
#windows .esg .esg-sh-note { margin: 0; font-size: var(--fs-sm, 14px); color: var(--esg-mute); }
#windows .esg .esg-sh h6 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
#windows .esg .esg-sh h6 span { display: grid; min-width: 0; }
#windows .esg .esg-sh h6 b { font-size: var(--fs-name, 18px); }
#windows .esg .esg-sh h6 small { font-size: var(--fs-xs, 12px); color: var(--esg-mute); font-weight: 400; }
#windows .esg .esg-sh.s-flame h6 b { color: #b4541e; } #windows .esg .esg-sh.s-bell h6 b { color: #8a6a1c; } #windows .esg .esg-sh.s-breeze h6 b { color: #3f7a48; } #windows .esg .esg-sh.s-wonder h6 b { color: #6a44a8; }
#windows .esg .esg-sh ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
#windows .esg .esg-sh li { display: grid; justify-items: center; align-content: start; gap: 3px; padding: 8px 6px; border-radius: 12px; background: #fbf1da; text-align: center; }
#windows .esg .esg-sh li b { font-size: var(--fs-sm, 14px); }
#windows .esg .esg-sh li b em { font-style: normal; color: #c58a1a; }
#windows .esg .esg-sh li small.fx { font-size: var(--fs-xs, 12px); color: var(--esg-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#windows .esg .esg-sh li small.rg { font-size: var(--fs-xs, 12px); color: var(--esg-teal); font-weight: 700; }
html:not(.touch-ui) #windows .esg .esg-sh li .cst-m { width: 80px; height: 120px; }
html.touch-ui #windows .esg .esg-sh ul { display: flex; overflow-x: auto; scroll-snap-type: x proximity; }
html.touch-ui #windows .esg .esg-sh li { flex: 0 0 132px; scroll-snap-align: start; }
html.touch-ui #windows .esg .esg-sh li small.fx { -webkit-line-clamp: 1; }
/* v3 มือถือ: แท็บเพิ่ม 44px → การ์ดโซนเตี้ยลง + รางวัลแถวเดียว 5 ช่อง (ไอคอนบน ตัวเลขล่าง) ให้พอดีจอไม่ต้องเลื่อน */
html.touch-ui #windows .esg .esg-z { min-height: 78px; padding: 6px 8px 8px; }
html.touch-ui #windows .esg .esg-z > .esg-zf { top: 4px; left: 4px; }
html.touch-ui #windows .esg .esg-rw { grid-template-columns: repeat(5, minmax(0, 1fr)); }
html.touch-ui #windows .esg .esg-rw li { display: flex; flex-direction: column; justify-content: center; gap: 1px; min-height: 52px; padding: 3px 2px; text-align: center; }
html.touch-ui #windows .esg .esg-rw li b { grid-row: auto; display: block; max-width: 100%; }
html.touch-ui #windows .esg .esg-rw li.envs .ic { gap: 1px; }

/* ── ui-spiral-1029: กระดานผู้พิชิต (แท่น 1–3 · หน้าผู้เล่น · การ์ดภาพโซน · เหรียญฉายา) — รากเดียว .esgb (ห้ามใช้ .spb/.sp* ชนหน้าอื่น) ── */
#windows .esg .esgb { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 10px; align-items: start; }
#windows .esg .esgb-side { display: grid; gap: 10px; min-width: 0; }
#windows .esg .esgb .esg-h img { width: 30px; height: 30px; }
#windows .esg .esgb-me { margin-left: auto; padding: 2px 10px; border-radius: 999px; background: #e3f1ee; color: var(--esg-teal); font-size: var(--fs-xs, 12px); font-weight: 700; }
#windows .esg .esgb-sub { margin-left: 4px; font-size: var(--fs-xs, 12px); color: var(--esg-mute); font-weight: 400; }
#windows .esg .esgb-deep { background: radial-gradient(120% 80% at 50% 0%, #fff6dc 0%, #fffdf6 60%); }
/* แท่น: ภาพเต็มกว้าง · ช่อง 1–3 วางบนหน้าตัดของแต่ละแท่น (ตำแหน่งตามภาพ podium.webp 512×303) */
#windows .esg .esgb-pod { position: relative; width: 100%; max-width: 520px; margin: 40px auto 0; aspect-ratio: 512 / 303; }
#windows .esg .esgb-podimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#windows .esg .esgb-slot { position: absolute; display: grid; justify-items: center; gap: 1px; width: 31%; text-align: center; transform: translateX(-50%); }
#windows .esg .esgb-slot.p1 { left: 50%; bottom: 53%; }
#windows .esg .esgb-slot.p2 { left: 18%; bottom: 36%; }
#windows .esg .esgb-slot.p3 { left: 82%; bottom: 36%; }
#windows .esg .esgb-crown { width: 44px; height: 44px; margin-bottom: -10px; position: relative; z-index: 1; filter: drop-shadow(0 2px 2px rgba(60, 30, 0, .35)); }
#windows .esg .esgb-slot .esgb-fl { padding: 1px 10px; border-radius: 999px; background: linear-gradient(180deg, #fbe7b0, var(--esg-gold)); color: #4a2f0c; font-size: var(--fs-sm, 14px); box-shadow: 0 2px 0 #a8792a; white-space: nowrap; }
#windows .esg .esgb-slot.p1 .esgb-fl { font-size: var(--fs-body, 16px); }
#windows .esg .esgb-slot small { max-width: 100%; padding: 0 6px; border-radius: 8px; background: rgba(255, 250, 238, .9); color: var(--esg-ink); font-size: var(--fs-xs, 12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#windows .esg .esgb-slot.me .esgb-fl { box-shadow: 0 0 0 3px rgba(47, 111, 115, .55), 0 2px 0 #a8792a; }
#windows .esg .esgb-slot.open { gap: 2px; }
#windows .esg .esgb-q { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px dashed rgba(122, 101, 72, .55); background: rgba(255, 250, 238, .7); color: var(--esg-mute); font-weight: 800; font-size: var(--fs-name, 18px); }
#windows .esg .esgb-slot.open small { background: rgba(255, 250, 238, .94); color: var(--esg-ink, #3e2c16); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
/* หน้าผู้เล่น (rank-faces · ui-garden.css .rk-face) ซ้อนกันเล็กน้อย */
#windows .esg .esgb-faces { display: inline-flex; align-items: center; }
#windows .esg .esgb-faces .rk-face { width: 44px; height: 44px; border: 2px solid #fffaf0; background: #e9dcc0; box-shadow: 0 2px 4px rgba(60, 40, 10, .25); }
#windows .esg .esgb-faces .rk-face + .rk-face { margin-left: -14px; }
#windows .esg .esgb-slot.p1 .esgb-faces .rk-face { width: 52px; height: 52px; border-color: var(--esg-gold); }
#windows .esg .esgb-faces em { margin-left: 2px; font-style: normal; font-size: var(--fs-xs, 12px); font-weight: 700; color: var(--esg-mute); }
#windows .esg .esgb-rows { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
#windows .esg .esgb-rows li { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 2px 10px 2px 6px; border-radius: 12px; background: #fbf1da; font-size: var(--fs-sm, 14px); }
#windows .esg .esgb-rows li.me { background: #e3f1ee; }
#windows .esg .esgb-rows li > i { flex: none; width: 24px; text-align: center; font-style: normal; font-weight: 800; color: var(--esg-navy); }
#windows .esg .esgb-rows .esgb-faces .rk-face { width: 34px; height: 34px; }
#windows .esg .esgb-rows li > span:not(.esgb-faces) { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#windows .esg .esgb-rows li > b { color: var(--esg-teal); white-space: nowrap; }
/* ว่าง: ภาพประกอบเล็ก + ข้อความชวน + ปุ่มไปลงวงก์ */
#windows .esg .esgb-inv { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 10px; border-radius: 14px; background: linear-gradient(90deg, #eef1fb, #fbf1da); border: 2px dashed #c9d3ec; }
#windows .esg .esgb-inv img { flex: none; width: 96px; height: auto; }
#windows .esg .esgb-inv p { flex: 1 1 auto; display: grid; gap: 2px; margin: 0; min-width: 0; }
#windows .esg .esgb-inv b { font-size: var(--fs-body, 16px); color: var(--esg-navy); }
#windows .esg .esgb-inv small { font-size: var(--fs-xs, 12px); color: var(--esg-mute); }
#windows .esg .esgb-cta { flex: none; min-height: var(--btn-h, 44px); padding: 0 16px; border: 0; border-radius: 999px; background: linear-gradient(180deg, #6fc46a, #3f9a46); color: #fff; font-weight: 800; font-size: var(--fs-sm, 14px); box-shadow: 0 3px 0 #2b6e31; cursor: pointer; white-space: nowrap; }
/* เร็วสุดต่อโซน = การ์ดภาพโซน */
#windows .esg .esgb-zl { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#windows .esg .esgb-zc { position: relative; display: flex; align-items: center; gap: 10px; min-height: 76px; padding: 8px 12px; border-radius: 14px; overflow: hidden; border: 2px solid var(--esg-line); color: #fff6dc; }
#windows .esg .esgb-zimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#windows .esg .esgb-zc::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 16, 34, .8) 0%, rgba(14, 16, 34, .45) 55%, rgba(14, 16, 34, .7) 100%); }
#windows .esg .esgb-zc > :not(img) { position: relative; z-index: 1; }
#windows .esg .esgb-zn { display: grid; flex: 0 0 auto; min-width: 74px; text-shadow: 0 1px 3px #000a; }
#windows .esg .esgb-zn b { font-size: var(--fs-name, 18px); line-height: 1.1; }
#windows .esg .esgb-zn small { font-size: var(--fs-xs, 12px); opacity: .9; }
#windows .esg .esgb-zt { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 8px; justify-items: end; }
#windows .esg .esgb-zt > b { grid-row: 1 / 3; font-size: var(--fs-hero, 24px); color: #ffe08a; text-shadow: 0 2px 3px #000a; font-variant-numeric: tabular-nums; }
#windows .esg .esgb-zt small { max-width: 100%; font-size: var(--fs-xs, 12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000a; }
#windows .esg .esgb-zt .esgb-faces .rk-face { width: 34px; height: 34px; }
#windows .esg .esgb-zc.none .esgb-zt { grid-template-columns: auto; justify-items: end; }
#windows .esg .esgb-zc.none .esgb-zt > b { grid-row: auto; opacity: .6; }
#windows .esg .esgb-zc.none .esgb-zt small { white-space: normal; text-align: right; }
/* ฉายาถาวร = เหรียญภาพจริง · ล็อก = เงาจาง */
#windows .esg .esgb-hon ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
#windows .esg .esgb-hon li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; background: #fbf1da; min-width: 0; }
#windows .esg .esgb-hon li img { flex: none; width: 56px; height: 56px; object-fit: contain; }
#windows .esg .esgb-hon li span { display: grid; min-width: 0; }
#windows .esg .esgb-hon li b { font-size: var(--fs-sm, 14px); color: var(--esg-ink); }
#windows .esg .esgb-hon li small { font-size: var(--fs-xs, 12px); color: var(--esg-mute); }
#windows .esg .esgb-hon li.got { background: linear-gradient(180deg, #fff6dc, #f5e3b0); box-shadow: inset 0 0 0 2px var(--esg-gold); }
#windows .esg .esgb-hon li.got small { color: var(--esg-teal); font-weight: 700; }
#windows .esg .esgb-hon li.lock img { filter: grayscale(1) brightness(.85); opacity: .45; }
/* มือถือแนวนอน: สองคอลัมน์เดิม ย่อแท่น/การ์ด */
html.touch-ui #windows .esg .esgb { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
html.touch-ui #windows .esg .esgb .esg-card { padding: 6px 8px; }
html.touch-ui #windows .esg .esgb .esg-h { margin: 0 0 2px; font-size: var(--fs-sm, 14px); }
html.touch-ui #windows .esg .esgb .esg-h img { width: 24px; height: 24px; }
html.touch-ui #windows .esg .esgb-sub { display: none; }
html.touch-ui #windows .esg .esgb-pod { max-width: 300px; }
html.touch-ui #windows .esg .esgb-crown { width: 32px; height: 32px; margin-bottom: -8px; }
html.touch-ui #windows .esg .esgb-faces .rk-face { width: 34px; height: 34px; }
html.touch-ui #windows .esg .esgb-slot.p1 .esgb-faces .rk-face { width: 40px; height: 40px; }
html.touch-ui #windows .esg .esgb-q { width: 36px; height: 36px; }
html.touch-ui #windows .esg .esgb-slot .esgb-fl, html.touch-ui #windows .esg .esgb-slot.p1 .esgb-fl { font-size: var(--fs-xs, 12px); }
html.touch-ui #windows .esg .esgb-inv { gap: 6px; padding: 6px 8px; flex-wrap: wrap; }
html.touch-ui #windows .esg .esgb-inv img { width: 64px; }
html.touch-ui #windows .esg .esgb-inv p { flex-basis: 120px; }
html.touch-ui #windows .esg .esgb-inv b { font-size: var(--fs-sm, 14px); }
html.touch-ui #windows .esg .esgb-zc { min-height: 60px; padding: 4px 10px; }
html.touch-ui #windows .esg .esgb-zn b { font-size: var(--fs-body, 16px); }
html.touch-ui #windows .esg .esgb-zt > b { font-size: var(--fs-title, 20px); }
html.touch-ui #windows .esg .esgb-hon li img { width: 44px; height: 44px; }
html:not(.touch-ui) #windows .esg .esgb-deep { padding-bottom: 14px; }
html:not(.touch-ui) #windows .esg .esgb .esg-h { font-size: var(--fs-name, 18px); }
html:not(.touch-ui) #windows .esg .esgb-rows li, html:not(.touch-ui) #windows .esg .esgb-hon li b { font-size: var(--fs-body, 16px); }
html:not(.touch-ui) #windows .esg .esgb-hon li small, html:not(.touch-ui) #windows .esg .esgb-inv small, html:not(.touch-ui) #windows .esg .esgb-zt small { font-size: var(--fs-sm, 14px); }
html:not(.touch-ui) #windows .esg .esgb-zc { min-height: 96px; }
html:not(.touch-ui) #windows .esg .esgb-hon li img { width: 72px; height: 72px; }
/* รางวัลหน้าประตู: ซองแตะได้ */
#windows .esg .esg-rw li.envs { cursor: pointer; border: 2px solid transparent; }
#windows .esg .esg-rw li.envs:hover { border-color: var(--esg-gold); }
#windows .esg .esg-rw li.envs b { color: var(--esg-teal); }
.bf-reward li.cenv { cursor: pointer; box-shadow: inset 0 0 0 2px rgba(232, 182, 74, .6); }

/* ── แผ่นลอย: แสตมป์ในซอง / รายละเอียดแสตมป์ (cstamp-ui.js openEnvSheet · openCstDetail) — รากเดียว .cstsh ลูกตรง <body> role=dialog ── */
.cstsh { position: fixed; inset: 0; z-index: 9200; /* เหนือการ์ดรางวัลวงก์ .bf-reward (9150) และการ์ดไอเทม .icard (9000) ที่เปิดแผ่นนี้ — ชั้น "own" ของ liftAsk */ display: grid; place-items: center; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); background: rgba(20, 24, 40, .5); }
.cstsh .cstsh-box { width: min(96vw, 860px); max-height: 100%; overflow-y: auto; display: grid; gap: 8px; padding: 10px 14px 12px; border-radius: 18px; background: #fffaf0; border: 3px solid #e6d3a8; box-shadow: 0 10px 30px rgba(20, 16, 8, .35); color: #3e2a14; }
.cstsh .cstsh-h { display: flex; align-items: center; gap: 10px; }
.cstsh .cstsh-h > span:not(.cst-env) { flex: 1 1 auto; display: grid; min-width: 0; }
.cstsh .cstsh-h b { font-size: var(--fs-title, 20px); }
.cstsh .cstsh-h small { font-size: var(--fs-sm, 14px); color: #7a6548; }
.cstsh .cstsh-h.s-flame b { color: #b4541e; } .cstsh .cstsh-h.s-bell b { color: #8a6a1c; } .cstsh .cstsh-h.s-breeze b { color: #3f7a48; } .cstsh .cstsh-h.s-wonder b { color: #6a44a8; } .cstsh .cstsh-h.s-life b { color: #b45a3a; }
.cstsh .cstsh-h .cst-env-m { width: 44px; height: 60px; }
.cstsh .cstsh-x { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f1e6cc; color: #5a4526; font-size: var(--fs-name, 18px); font-weight: 800; cursor: pointer; }
.cstsh .cstsh-tabs { display: flex; gap: 6px; overflow-x: auto; }
.cstsh .cstsh-tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 2px 12px 2px 6px; border: 2px solid #e6d3a8; border-radius: 12px; background: #fff; color: #5a4526; font-size: var(--fs-sm, 14px); font-weight: 700; cursor: pointer; }
.cstsh .cstsh-tabs button.on { border-color: #e8b64a; background: linear-gradient(180deg, #fff6dc, #f5dc9c); color: #4a2f0c; }
.cstsh .cstsh-tabs .cst-env { width: 26px; height: 36px; }
.cstsh .cstsh-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cstsh .cstsh-list li { display: grid; justify-items: center; align-content: start; gap: 3px; padding: 8px 6px; border-radius: 12px; background: #fbf1da; text-align: center; min-width: 0; }
.cstsh .cstsh-list li .cst-m { width: 80px; height: 120px; }
.cstsh .cstsh-list li b { font-size: var(--fs-sm, 14px); }
.cstsh .cstsh-list li b .hrt { font-style: normal; color: #c58a1a; }
.cstsh .cstsh-list li small.fx { font-size: var(--fs-xs, 12px); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cstsh .cstsh-list li small.rg { font-size: var(--fs-xs, 12px); color: #2f6f73; font-weight: 700; }
.cstsh .cstsh-list li em.own, #windows .esg .esg-sh li em.own { font-style: normal; font-size: var(--fs-xs, 12px); font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #efe6d2; color: #8a7a62; }
.cstsh .cstsh-list li em.own.got, #windows .esg .esg-sh li em.own.got { background: #2f6f73; color: #fff; }
.cstsh .cstsh-list li em.own.soon { background: #f2b8a8; color: #5a2a1a; }
.cstsh .cstsh-list li.got { box-shadow: inset 0 0 0 2px rgba(47, 111, 115, .45); }
.cstsh .cstsh-bon, .cstsh .cstsh-note { margin: 0; font-size: var(--fs-sm, 14px); }
.cstsh .cstsh-note { font-size: var(--fs-xs, 12px); color: #7a6548; }
.cstsh .cstsh-foot { position: sticky; bottom: -12px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 6px 0 2px; background: linear-gradient(180deg, rgba(255, 250, 240, 0), #fffaf0 30%); }
.cstsh .cstsh-main { min-height: var(--btn-h-main, 52px); padding: 0 22px; border: 0; border-radius: 16px; background: linear-gradient(180deg, #6fc46a, #3f9a46); color: #fff; font-weight: 800; font-size: var(--fs-btn-main, 18px); box-shadow: 0 4px 0 #2b6e31; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.cstsh .cstsh-main small { font-size: var(--fs-xs, 12px); opacity: .9; }
.cstsh .cstsh-main .ui-ic { width: 20px; height: 20px; }
.cstsh .cstsh-sub { min-height: var(--btn-h, 44px); padding: 0 16px; border: 2px solid #c9d3ec; border-radius: 14px; background: #fff; color: #3a5a9c; font-weight: 700; font-size: var(--fs-sm, 14px); cursor: pointer; }
.cstsh .cstd { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.cstsh .cstd-art { display: grid; place-items: center; padding: 8px; border-radius: 16px; background: radial-gradient(circle at 50% 40%, #fff6dc, #f1e2bd); }
.cstsh .cstd-i { display: grid; gap: 6px; min-width: 0; }
.cstsh .cstd-i p { margin: 0; font-size: var(--fs-sm, 14px); }
.cstsh .cstd-i p.cstd-fx { font-size: var(--fs-body, 16px); font-weight: 700; }
.cstsh .cstd-i p.cstd-who { padding: 3px 10px; border-radius: 10px; background: #e9eef8; color: #3a5a9c; font-weight: 700; justify-self: start; }
.cstsh .cstd-pp { display: flex; align-items: center; gap: 8px; }
.cstsh .cstd-pp .sj-pips { display: flex; gap: 3px; }
.cstsh .cstd-pp .sj-pips i { display: inline-grid; place-items: center; width: 22px; height: 20px; border-radius: 6px; border: 1px solid #dccca8; background: #fff; color: #c2b392; font-style: normal; font-weight: 700; font-size: var(--fs-xs, 12px); }
.cstsh .cstd-pp .sj-pips i.on { border-color: transparent; color: #fff; }
.cstsh .cstd-pp .sj-pips i.rC.on { background: #6fae5a; } .cstsh .cstd-pp .sj-pips i.rB.on { background: #4a8fd0; } .cstsh .cstd-pp .sj-pips i.rA.on { background: #9a6ad8; } .cstsh .cstd-pp .sj-pips i.rS.on { background: #e8b64a; }
.cstsh .cstd-i p.cstd-own { padding: 4px 10px; border-radius: 10px; background: #efe6d2; color: #7a6548; font-weight: 700; }
.cstsh .cstd-i p.cstd-own.got { background: #e3f1ee; color: #2f6f73; }
.cstsh .cstd-rt { border-collapse: collapse; font-size: var(--fs-sm, 14px); }
.cstsh .cstd-rt th, .cstsh .cstd-rt td { padding: 3px 10px; border-bottom: 1px solid #ecdfc0; text-align: left; }
.cstsh .cstd-rt th { font-size: var(--fs-xs, 12px); color: #7a6548; }
.cstsh .cstd-src b { color: #2f6f73; margin-right: 4px; }
.cstsh .cstc-hrt { font-style: normal; color: #c58a1a; font-size: var(--fs-sm, 14px); }
html.touch-ui .cstsh .cstsh-box { width: min(98vw, 820px); padding: 6px 10px 8px; gap: 6px; }
html.touch-ui .cstsh .cstsh-h b { font-size: var(--fs-name, 18px); }
html.touch-ui .cstsh .cstsh-h small { font-size: var(--fs-xs, 12px); }
html.touch-ui .cstsh .cstsh-list li { padding: 6px 4px; }
html.touch-ui .cstsh .cstsh-list li .cst-m { width: 56px; height: 84px; }
html.touch-ui .cstsh .cstsh-main { min-height: 48px; }
html.touch-ui .cstsh .cstd .cst-l { width: 96px; height: 144px; }
@media (max-width: 560px) { .cstsh .cstsh-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* เงา (ยังไม่มี) — เห็นรูปทรงแต่สีจาง */
.cst.sil { filter: grayscale(1) brightness(1.05) contrast(.7); opacity: .42; }

/* ── หน้าสะสม (สมุดแสตมป์ › รายการ · หน้าแปะ › 🌀) — การ์ดใช้ sj-* ของสมุดเดิม · ส่วนเพิ่มอยู่ใต้ .sjk / .cstc ── */
#windows .sjk { display: flex; gap: 6px; margin: 0 0 8px; overflow-x: auto; }
#windows .sjk .sjk-b { flex: 1 1 0; min-width: 120px; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; min-height: 52px; padding: 4px 12px; border-radius: 14px; border: 2px solid #e3d2a8; background: #fffaf0; color: #5b4526; text-align: left; cursor: pointer; }
#windows .sjk .sjk-b i { grid-row: 1 / 3; font-style: normal; font-size: var(--fs-title, 20px); }
#windows .sjk .sjk-b b { font-size: var(--fs-body, 16px); }
#windows .sjk .sjk-b small { font-size: var(--fs-xs, 12px); color: #7a6548; }
#windows .sjk .sjk-b.on { border-color: #e8b64a; background: linear-gradient(180deg, #fff6dc, #f8e3a8); box-shadow: 0 2px 0 #c9a050; color: #4a2f0c; }
#windows .sjk .sjk-b.k-dun.on { border-color: #3a5a9c; background: linear-gradient(180deg, #eef1fb, #d6def4); box-shadow: 0 2px 0 #8a9cc8; }
#windows .sjk .sjk-b.k-event.on { border-color: #e39a82; background: linear-gradient(180deg, #fff1ea, #f9d6c8); box-shadow: 0 2px 0 #d49a84; }
/* stamp-ux-1106 C: ภาพแถบแท็บ มอนสเตอร์/ดันเจี้ยน/กิจกรรม (assets/ui/stamp/tabs · ภาพชิดขวา · ซ้ายไล่ครีมให้ตัวหนังสืออ่านออก)
   ไม่เลือก = ภาพจางลดสี · เลือก = ภาพเต็ม + ขอบสีของแท็บ · ภาพ UI ล้วน (ไม่กระทบ perf ฉาก) — ลบกฎชุดนี้ = แบบเดิม */
#windows .sjk .sjk-b { position: relative; overflow: hidden; isolation: isolate; --sjk-fade: #fffaf0; }
#windows .sjk .sjk-b::before, #windows .sjk .sjk-b::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
#windows .sjk .sjk-b::before { background: var(--sjk-art, none) right center / cover no-repeat; opacity: .45; filter: saturate(.45); }
#windows .sjk .sjk-b::after { background: linear-gradient(90deg, var(--sjk-fade) 0 30%, color-mix(in srgb, var(--sjk-fade) 85%, transparent) 46%, transparent 74%); }
#windows .sjk .sjk-b.on::before { opacity: 1; filter: none; }
#windows .sjk .sjk-b.k-mob { --sjk-art: url(assets/ui/stamp/tabs/mob.webp); }
#windows .sjk .sjk-b.k-dun { --sjk-art: url(assets/ui/stamp/tabs/dun.webp); }
#windows .sjk .sjk-b.k-event { --sjk-art: url(assets/ui/stamp/tabs/event.webp); }
#windows .sjk .sjk-b.on { --sjk-fade: #fff6dc; } #windows .sjk .sjk-b.k-dun.on { --sjk-fade: #eef1fb; } #windows .sjk .sjk-b.k-event.on { --sjk-fade: #fff1ea; }
#windows .cstc { display: grid; gap: 8px; }
#windows .cstc .cstc-hero.k-dun .sj-hero-art { object-position: 60% 50%; }
#windows .cstc .cstc-hero.k-event { background: #fbe4d8; }
#windows .cstc .cstc-hero.k-event .sj-hero-art { object-fit: contain; object-position: 100% 50%; }
#windows .cstc .cstc-ic { font-style: normal; font-size: var(--fs-title, 20px); }
#windows .cstc .cstc-bon { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 6px 10px; border-radius: 12px; background: #eef1fb; font-size: var(--fs-sm, 14px); }
#windows .cstc .cstc-bon b { color: #3a5a9c; }
#windows .cstc .cstc-bon span { color: #7a6548; font-size: var(--fs-xs, 12px); }
#windows .cstc .cstc-bon em { font-style: normal; padding: 2px 8px; border-radius: 999px; background: #3a5a9c; color: #fff; font-size: var(--fs-xs, 12px); }
#windows .cstc .cstc-grid { margin-top: 0; }
#windows .cstc .cstc-rh { padding-left: 4px; }
#windows .cstc .cstc-env { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 48px; padding: 0; border: 0; background: none; cursor: pointer; }
#windows .cstc .cstc-env .cst-env { width: 34px; height: 46px; }
#windows .cstc .cstc-rh.s-flame .sj-rh-t b { color: #b4541e; } #windows .cstc .cstc-rh.s-bell .sj-rh-t b { color: #8a6a1c; } #windows .cstc .cstc-rh.s-breeze .sj-rh-t b { color: #3f7a48; } #windows .cstc .cstc-rh.s-wonder .sj-rh-t b { color: #6a44a8; }
#windows .cstc .sj-cimg .cst { width: 54px; height: 81px; }
#windows .cstc .sj-cimg .cst .g { font-size: var(--fs-hero, 24px); }
#windows .cstc .cstc-hrt { font-style: normal; color: #c58a1a; }
#windows .cstc .cstc-fx { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-xs, 12px); color: #7a6548; }
#windows .cstc .cstc-fx b { color: #2f6f73; }
#windows .cstc .cstc-soon { justify-self: start; font-style: normal; padding: 1px 8px; border-radius: 999px; background: #f2b8a8; color: #5a2a1a; font-size: var(--fs-xs, 12px); font-weight: 700; }
#windows .cstc .sj-cb { display: grid; gap: 3px; min-width: 0; }
#windows .cx.sbk-m .cstc .sj-cimg .cst { width: 46px; height: 69px; }
html.touch-ui #windows .sjk .sjk-b { min-height: 48px; padding: 2px 10px; }
html.touch-ui #windows .sjk .sjk-b b { font-size: var(--fs-sm, 14px); }
#windows .spg-cst { display: block; padding: 0 8px 8px; --sj-cream: #fffaf0; --sj-paper: #fffdf6; --sj-ln: #e6d6b0; --sj-teal: #2f6f73; --sj-gold: #e8b64a; --sj-ink: #3e2c16; --sj-mute: #7a6540; }   /* ux 30 ต.ค. ข้อ 9: ตัวแปร --sj-* อยู่แค่ในสมุด → แถบคืบหน้า (gradient ใช้ var) ไม่เติมสี · .spg เป็น grid 260px+1fr → เนื้อหากว้าง ~70% */
#windows .spg-cst .spg-tabs { margin-bottom: 8px; }

/* การ์ดไอเทม: ซองแสตมป์ดัน — แถวภาพแสตมป์ในซอง + ปุ่มดูทั้งหมด */
.icard .cstib { display: grid; gap: 6px; margin: 6px 0; padding: 8px; border-radius: 12px; background: #eef1fb; }
.icard .cstib p { margin: 0; font-size: var(--fs-sm, 14px); color: #3a5a9c; font-weight: 700; }
.icard .cstib-row { display: flex; gap: 4px; flex-wrap: wrap; }
.icard .cstib-go { min-height: var(--btn-h, 44px); border: 2px solid #c9d3ec; border-radius: 12px; background: #fff; color: #3a5a9c; font-weight: 700; font-size: var(--fs-sm, 14px); cursor: pointer; }

/* ── ui-spiral-1029 รอบ 2 (ผู้ใช้ลองคอม Lv 99 · en: "ปุ่มดูแสตมป์ ตรงไหน ไม่เห็นมี") ── */
/* ปุ่ม "ดูแสตมป์ในซอง" = ปุ่มจริงมีภาพซอง (ไม่ใช่ลิงก์จาง) */
#windows .esg .esg-see { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: var(--btn-h, 44px); padding: 2px 14px 2px 8px; border: 2px solid var(--esg-gold); border-radius: 14px;
  background: linear-gradient(180deg, #fff6dc, #f5dc9c); color: #4a2f0c; font-weight: 800; font-size: var(--fs-sm, 14px); box-shadow: 0 2px 0 #a8792a; cursor: pointer; white-space: nowrap; }
#windows .esg .esg-see:hover { background: linear-gradient(180deg, #fffaf0, #f8e3a8); }
#windows .esg .esg-see-env { display: inline-flex; }
#windows .esg .esg-see-env .cst-env { width: 22px; height: 30px; }
#windows .esg .esg-see-env .cst-env + .cst-env { margin-left: -8px; }
html:not(.touch-ui) #windows .esg .esg-see { font-size: var(--fs-body, 16px); }
html:not(.touch-ui) #windows .esg .esg-see-env .cst-env { width: 28px; height: 38px; }
/* พี่เลี้ยง: รางวัลยังโชว์ แต่จาง + ป้าย */
#windows .esg .esg-mentor { margin: 0 0 6px; padding: 4px 10px; border-radius: 10px; background: #e3f1ee; color: var(--esg-teal); font-weight: 700; font-size: var(--fs-sm, 14px); display: flex; align-items: center; gap: 6px; }
#windows .esg .esg-rw.dim > li { opacity: .55; filter: saturate(.5); }
#windows .esg .esg-rw.dim > li.envs { opacity: .8; }
/* แสตมป์เด่นของโซน (คอมเท่านั้น — มือถือมีปุ่มดูแสตมป์แทน) */
#windows .esg .esg-feat { display: none; }
html:not(.touch-ui) #windows .esg .esg-feat { display: block; }
#windows .esg .esg-feat .esg-h small { margin-left: 8px; font-size: var(--fs-xs, 12px); color: var(--esg-mute); font-weight: 400; }
#windows .esg .esg-feat ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
#windows .esg .esg-feat li > button { width: 100%; height: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 10px; border: 2px solid transparent; border-radius: 14px; background: #fbf1da; color: var(--esg-ink); text-align: left; cursor: pointer; }
#windows .esg .esg-feat li > button:hover { border-color: var(--esg-gold); }
#windows .esg .esg-feat .cst-m { width: 64px; height: 96px; }
#windows .esg .esg-feat li span { display: grid; gap: 3px; min-width: 0; }
#windows .esg .esg-feat li b { font-size: var(--fs-body, 16px); }
#windows .esg .esg-feat li b em { font-style: normal; color: #c58a1a; }
#windows .esg .esg-feat li small { font-size: var(--fs-sm, 14px); color: var(--esg-mute); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#windows .esg .esg-feat li small.st { font-weight: 700; }
#windows .esg .esg-feat li small.st.s-flame { color: #b4541e; } #windows .esg .esg-feat li small.st.s-bell { color: #8a6a1c; } #windows .esg .esg-feat li small.st.s-breeze { color: #3f7a48; } #windows .esg .esg-feat li small.st.s-wonder { color: #6a44a8; }
#windows .esg .esg-feat li small.rg { color: var(--esg-teal); font-weight: 700; }
#windows .esg .esg-feat li em.own { justify-self: start; font-style: normal; font-size: var(--fs-xs, 12px); font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #efe6d2; color: #8a7a62; }
#windows .esg .esg-feat li em.own.got { background: #2f6f73; color: #fff; }

/* ui-spiral-1029: หน้าต่างวงก์บนจอสัมผัสเตี้ย = กรอบเดียวกับหน้าหอระฆัง (.bfm-on) — สลับดันแล้วหน้าต่างไม่หด/ขยาย (เดิม 828 → 600 px ที่ 844×390) */
@media (max-height: 520px) {
  html.touch-ui body #windows .win[data-win="belfry"][data-level].esg-win:not([hidden]) {
    left: calc(var(--sa-l) + 8px) !important; right: calc(var(--sa-r) + 8px) !important; top: calc(var(--sa-t) + 6px) !important; bottom: calc(var(--sa-b) + 6px) !important; width: auto !important; max-width: none !important; }
}

/* ── ui-spiral-1029 รอบผู้ตรวจ UX อิสระ ── */
/* การ์ดเลือกดันหน้าหอระฆัง: ภาพเหรียญ/ซองเดียวกับตัวสลับหน้าวงก์ · ป้าย "ใหม่" · รางซ้ายมือถือไม่ตัดชื่อ */
.bfx-mode { position: relative; }
img.bfx-mi { width: 36px; height: 40px; object-fit: contain; }
.bfx-new { position: absolute; top: -13px; right: 10px; left: auto; padding: 1px 8px; border-radius: 999px; background: #e0583a; color: #fff; font-style: normal; font-weight: 800; font-size: var(--fs-xs, 12px); box-shadow: 0 2px 0 #9a3220; }
.bfm-side .bfx-mode { padding: 6px; gap: 6px; }
.bfm-side img.bfx-mi { width: 28px; height: 32px; }
.bfm-side .bfx-mt b { font-size: var(--fs-sm, 14px); line-height: 1.15; white-space: normal; }
.bfm-side .bfx-mt small { display: none; }
/* พี่เลี้ยง: แถวที่ได้จริง (ตราช่วยทาง) เด่น · รางวัลโซนจาง (มือถือซ่อน) */
#windows .esg .esg-rw-me { margin-bottom: 4px; }
#windows .esg .esg-rw-me li { background: #e3f1ee; box-shadow: inset 0 0 0 2px rgba(47, 111, 115, .4); }
#windows .esg .esg-dimh { margin: 4px 0 4px; font-size: var(--fs-sm, 14px); font-weight: 600; color: #6a5638; }
html.touch-ui #windows .esg :is(.esg-rw.dim, .esg-dimh) { display: none; }
/* โอกาสซองต่อชั้น + เพดานสัปดาห์ (spiral-revive-1113 ข้อ 4d · เจ้าของ 13 พ.ย. ให้โชว์ %) — คอมแบบเต็ม · จอสัมผัสแบบสั้นบรรทัดเดียว (หน้าประตูพอดี 844×390 ไม่เลื่อน) */
#windows .esg .esg-envodds { margin: 6px 0 0; font-size: var(--fs-sm, 14px); font-weight: 600; color: #6a5638; line-height: 1.25; }
#windows .esg .esg-envodds .eo-s { display: none; }
/* แต้มเข้าหา S ที่หน้าประตู (R4 ข้อ 3 · โชว์เมื่อสวิตช์ sPath เปิด): คอม = บรรทัดของตัวเอง (.esg-marks) · จอสัมผัส (การ์ดเริ่มแคบ ไม่พอเพิ่มบรรทัด) = รวมในบรรทัดความคืบหน้าแบบสั้น (.eo-s) */
#windows .esg .esg-prog .eo-s { display: none; }
html.touch-ui #windows .esg .esg-prog .eo-l, html.touch-ui #windows .esg .esg-start.has-marks .esg-marks { display: none; }
html.touch-ui #windows .esg .esg-prog .eo-s { display: inline; }
html.touch-ui #windows .esg .esg-envodds { margin: 4px 0 0; font-size: var(--fs-xs, 12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.touch-ui #windows .esg .esg-envodds .eo-l { display: none; }
html.touch-ui #windows .esg .esg-envodds .eo-s { display: inline; }
html.touch-ui #windows .esg .esg-rw-me { grid-template-columns: minmax(0, 1fr); }
html.touch-ui #windows .esg .esg-rw-me li { flex-direction: row; justify-content: flex-start; gap: 8px; padding: 4px 10px; text-align: left; }
html.touch-ui #windows .esg .esg-rw-me li small { display: block; }
/* มือถือ: ตัวเลขรางวัลตัดบรรทัดได้ (อังกฤษ "224–1.3k" เดิมถูกตัด …) */
html.touch-ui #windows .esg .esg-rw li b { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.1; overflow-wrap: anywhere; }
/* ช่วงค่าภาษาคน ตัวไม่ต่ำกว่า fs-sm */
.cstsh .cstsh-list li small.rg, #windows .esg .esg-sh li small.rg, #windows .esg .esg-feat li small.rg { font-size: var(--fs-sm, 14px); }
.cstsh .cstsh-list li small.fx, #windows .esg .esg-sh li small.fx { font-size: var(--fs-sm, 14px); }
html.touch-ui .cstsh .cstsh-list li small.fx { font-size: var(--fs-xs, 12px); }
/* กระเป๋าในหน้าแปะ: ชื่อใต้แสตมป์ + คำแนะนำ */
.cst-hint { margin: 6px 0 0; font-size: var(--fs-xs, 12px); color: #3a5a9c; }
.cst-bag { min-width: 72px; gap: 2px; }
.cst-bag small.nm { max-width: 72px; font-size: var(--fs-xs, 12px); line-height: 1.1; color: #4a3a22; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* แถวพิเศษ: กรอบภาพ slot_reserve เดียวกับสมุด (ไม่ใช่เส้นประฟ้าเรียบ) */
.cst-cell { position: relative; border: 0; background: url(assets/ui/stamp/journal/slot_reserve.webp) center / contain no-repeat; min-height: 120px; align-content: center; }
.cst-cell > span { font-size: var(--fs-title, 20px); color: #8a6a3a; }
.cst-cell > b { padding: 1px 8px; border-radius: 999px; background: rgba(255, 250, 238, .92); color: #5b4526; }
.cst-cell.lock { opacity: 1; filter: grayscale(.6) brightness(.95); }
.cst-cell.full { border: 0; background-image: none; }
/* การ์ดไอเทมซอง: แถวแสตมป์สีจริง + ชื่อ */
.icard .cstib-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.icard .cstib-it { display: grid; justify-items: center; gap: 2px; text-align: center; min-width: 0; }
.icard .cstib-it small { max-width: 100%; font-size: var(--fs-xs, 12px); line-height: 1.1; color: #4a3520; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.icard .cstib-it.got small { color: #2f6f73; font-weight: 700; }
/* การ์ดเปิดซอง */
.cstsh .cstrv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.cstsh .cstrv-art { padding: 10px; border-radius: 18px; background: radial-gradient(circle at 50% 45%, #fff6dc, #f1e2bd); }
.cstsh .cstrv-art.rS { background: radial-gradient(circle at 50% 45%, #fff3c4, #f0c860); box-shadow: 0 0 0 3px #e8b64a; }
.cstsh .cstrv-art.rA { box-shadow: 0 0 0 3px #b48ae6; }
.cstsh .cstrv-i { display: grid; gap: 6px; min-width: 0; }
.cstsh .cstrv-i p { margin: 0; }
.cstsh .cstrv-n { font-size: var(--fs-hero, 24px); color: #3e2a14; }
.cstsh .cstrv-rk { display: flex; align-items: center; gap: 10px; }
.cstsh .cstrv-rk > b { font-size: var(--fs-name, 18px); color: #2f6f73; }
.cstsh .cstrv-fx { font-size: var(--fs-body, 16px); }
.cstsh .cstrv-where { font-size: var(--fs-sm, 14px); color: #7a6548; }
.cstsh .cstrv-why { font-size: var(--fs-sm, 14px); padding: 4px 10px; border-radius: 10px; background: #fbefd2; color: #8a5a12; }
.cstsh .cstrv-new { font-style: normal; padding: 0 8px; border-radius: 999px; background: #e0583a; color: #fff; font-weight: 800; }
html.touch-ui .cstsh .cstrv .cst-l { width: 96px; height: 144px; }
html.touch-ui .cstsh .cstrv-n { font-size: var(--fs-title, 20px); }
html.touch-ui .cstsh .cstrv-fx { font-size: var(--fs-sm, 14px); }

/* spiral-stamp-pvp-1030: แสตมป์ดันมีผลทั้งมอนและผู้เล่น */
.cst-wrap h5 .cst-who { font-weight: 700; color: #3a5a9c; font-size: var(--fs-xs, 12px); white-space: nowrap; }
.sj-hero-s.cst-who { color: #3a5a9c; font-weight: 700; }

/* ── ใบ dun-stamp-redesign-1030: อ่านง่ายแบบแสตมป์มอน — บรรทัดผลเดียว · ช่องว่างเส้นประ · หลอม/ย่อยบอกอัตรา · ฉากเปิดซองชุดเดียวกับแสตมป์มอน (.srv) ── */
.cst-wrap h5 { display: flex; align-items: baseline; gap: 6px; }
.cst-wrap h5 .cst-n { font-weight: 700; color: #6a7aa8; font-size: var(--fs-xs, 12px); }
.cst-cell.empty { background: none; border: 2px dashed #b9a57a; background-color: rgba(255, 250, 238, .55); }
.cst-cell.empty.on { border-color: #2f6f73; background-color: rgba(47, 111, 115, .1); }
.cst-cell .cst-dash { font-size: var(--fs-title, 20px); color: #8a6a3a; }
.cst-cell.lock .cst-lk { font-size: var(--fs-title, 20px); }
.cst-cell.full { align-content: start; padding-top: 4px; }
.cst-cell .cst-nm { max-width: 100%; padding: 0 2px; background: none; color: #4a3a22; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cst-cell .cst-sv { display: grid; gap: 0; width: 100%; min-width: 0; line-height: 1.15; font-size: var(--fs-xs, 12px); color: #6b5a3a; text-align: center; overflow-wrap: anywhere; }
.cst-cell .cst-sv > b { font-size: var(--fs-sm, 14px); color: #2f6f73; }
.cst-cell.full { justify-items: center; grid-template-columns: minmax(0, 1fr); }
.cst-cell.full > * { min-width: 0; }
.cst-cell .cst-nm { width: 100%; text-align: center; font-size: var(--fs-xs, 12px); }
/* หน้าแปะมือถือ: ชิปคอมโบ + "ใกล้ครบ" อยู่แถวเดียว (ข้อ 6 — เดิมปุ่มใกล้ครบลอยเดี่ยวกินที่) */
html.touch-ui body #windows .spg-side .cmb-chips { flex-wrap: nowrap; }
html.touch-ui body #windows .spg-side .cmb-chips .cmb-chip.on { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; }
html.touch-ui body #windows .spg-side .cmb-chips .cmb-chip[data-cmb-tab] { flex: none; }
.cst-cell .cst-zz { color: #6a5a8a; font-size: var(--fs-xs, 12px); line-height: 1.1; }
.cst-cell.zz .cst-nm { opacity: .7; }
.cst-bag.dim { opacity: .35; }
.cst-bag { position: relative; }
.cst-bag .cst-ck { position: absolute; right: 2px; top: 2px; font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: #2f6f73; color: #fff; display: grid; place-items: center; font-size: var(--fs-xs, 12px); }
.cst-bag small.nm { color: #2f6f73; font-weight: 700; }
.cst-fgo { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cst-fgo .rbtn, .cst-openall { min-height: var(--btn-h, 44px); }
.cst-openall { align-self: center; }
.cst-fbox { display: grid; gap: 4px; margin-top: 6px; padding: 8px 10px; border-radius: 12px; background: #fff7e2; border: 1.5px solid #e2c27a; }
.cst-fbox p { margin: 0; }
.cst-fbox .cst-ft { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: var(--fs-sm, 14px); color: #4a3a22; }
.cst-fbox .cst-fn { font-weight: 800; color: #2f6f73; }
.cst-fbox .cst-fw { font-size: var(--fs-sm, 14px); font-weight: 700; color: #a0402a; }
.cst-fbox .cst-fo { font-size: var(--fs-sm, 14px); color: #3a5a9c; font-weight: 700; line-height: 1.35; }
.cst-fbox .cst-fs { font-size: var(--fs-xs, 12px); color: #7a6548; }
.cst-fbox .cst-fa { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 2px; }
.cst-fbox .cst-fa .rbtn { min-height: var(--btn-h, 44px); }
.cst-fbox .cst-fa .rbtn.main { background: linear-gradient(#3f8584, #2f6f73); color: #fff; border-color: #245d60; }
.cst-fbox .cst-fa .rbtn:disabled { opacity: .5; }
/* กล่องผลรวมในหน้าแปะ: แถวแสตมป์ดัน */
.spg-totl li.cst-tot { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; }
.spg-totl li.cst-tot .cst-tot-i { font-style: normal; font-size: var(--fs-xs, 12px); }
.spg-totl li.cst-tot span { font-weight: 700; color: #3a5a9c; }
.spg-totl li.cst-tot small { font-size: var(--fs-xs, 12px); color: #7a6548; }
/* แผ่นซอง: อัตรา · แผ่นรายละเอียด: บรรทัดผลใหญ่ */
.cstsh .cstsh-odds { margin: 4px 0 0; font-size: var(--fs-sm, 14px); font-weight: 700; color: #3a5a9c; }
.cstsh .cstd-big { font-size: var(--fs-title, 20px); font-weight: 800; color: #2f6f73; }
.cstsh .cstd-zn { margin: 2px 0 0; font-size: var(--fs-xs, 12px); color: #7a6548; }
html.touch-ui .cstsh .cstd-big { font-size: var(--fs-name, 18px); }
.stp-rules-cst span { color: #3a5a9c; }
/* ฉากเปิดซองแสตมป์ดัน (#stamp-reveal.srv.cstx) */
.cstx .srv-stamp .cst-l { width: var(--sw); height: calc(var(--sw) * 1.5); }
.cstx .srv-env { translate: -50% -50%; }
.cstx-env { display: block; width: calc(var(--sw) * 1.02); aspect-ratio: 240 / 360; border-radius: 14px; background: var(--cst-bg); }
.cstx-env:has(img) { background: none; }
.cstx-env img { display: block; width: 100%; height: 100%; object-fit: contain; }
#stamp-reveal.cstx.s3:not(.done) .srv-stamp { animation: cstx-flip .5s cubic-bezier(.2, 1.2, .4, 1) 1 both; }
@keyframes cstx-flip { 0% { opacity: 0; transform: translateY(18%) rotateY(90deg) scale(.9); } 55% { opacity: 1; transform: translateY(-3%) rotateY(-12deg) scale(1.03); } 100% { opacity: 1; transform: none; } }
#stamp-reveal.cstx.promo.s1 .srv-tease { animation: cstx-promo 1s ease-out 1 both; }
@keyframes cstx-promo { 0% { opacity: 0; scale: .5; background-color: #9a6ad8; } 45% { opacity: .9; scale: 1; background-color: #9a6ad8; } 70% { opacity: 1; scale: 1.2; background-color: #e8b64a; } 100% { opacity: 1; scale: 1.1; background-color: #e8b64a; } }
.cstx .srv-rank { flex-wrap: wrap; }
.cstx .cstx-line { font-size: var(--fs-hero, 24px); font-weight: 800; line-height: 1.15; color: #2f6f73; }
.cstx.rS .cstx-line { color: #a8681a; }
.cstx .cstx-sub small, .cstx .cstx-set small { font-size: var(--fs-sm, 14px); color: #6b5a3a; }
.cstx .srv-name .cstc-hrt { font-style: normal; color: #c89a2a; }
.cstx.all .sra-row .cst { width: 36px; height: 54px; }
.cstx.all .sra-tx small { color: #2f6f73; font-weight: 700; }
html.touch-ui .cstx .cstx-line { font-size: var(--fs-title, 20px); }
.cstx-cel .cst-l { width: 120px; height: 180px; }
/* กระเป๋า: ป้าย Rank แสตมป์ไปมุมล่างซ้าย ไม่ทับหัวภาพ (ใบ dun-stamp-redesign-1030 ข้อ 15) */
html body .inv .slot .stp-tagr { top: auto; bottom: 2px; }
/* สมุดคอมโบมือถือ: แถบหมวดขึ้นแถวใหม่ (เดิมชนแท็บหลักจน "ใช้ซ้ำ" ถูกตัด) · ซ่อนตัวนับซ้ำ (แท็บคอมโบมี n/N แล้ว) — ใบ dun-stamp-redesign-1030 ข้อ 7 */
html.touch-ui body #windows .spg.spg-alb > .cmb-alb:not(.det) > .cmb-top { flex: 1 1 100%; }
html.touch-ui body #windows .spg.spg-alb .cmb-top > .cmb-count { display: none; }

/* stamp-confirm-1104: แตะแสตมป์ดันในกระเป๋า = แผ่นดูรายละเอียด + ปุ่ม "แปะ" (ไม่แปะเลย) */
.cst-pk { display: grid; gap: 4px; margin-top: 6px; padding: 8px 10px; border-radius: 12px; background: #fff7e2; border: 1.5px solid #e2c27a; }
.cst-pk p { margin: 0; color: #4a3a22; }
.cst-pk .cst-pkt { font-size: var(--fs-sm, 14px); }
.cst-pk .cst-pkl { font-size: var(--fs-sm, 14px); font-weight: 700; color: #2f6f73; }
.cst-pk .cst-pkn { font-size: var(--fs-xs, 12px); }
.cst-pk .cst-pkw { font-size: var(--fs-xs, 12px); color: #a4552a; font-weight: 700; }

/* stamp-confirm-1104 รอบ 2: แถวพิเศษใช้ลากวาง + แตะเลือกเหมือนแถวหลัก */
.cst-pk .cst-pkh { font-size: var(--fs-xs, 12px); color: #245d60; font-weight: 700; }
.cst-cell.cand:not(.on) { border-color: #2f6f73; background-color: rgba(47, 111, 115, .1); }
.cst-cell.full.sel { outline: 3px solid #e8b64a; outline-offset: -3px; border-radius: 12px; }
html body #windows .spg.dnd .cst-cell.dnd-ok { border: 2px dashed #2f6f73; background-color: #eef7f4; box-shadow: 0 0 0 3px #2f6f7340; }
html body #windows .spg.dnd .cst-cell.dnd-no { opacity: .45; }
html body #windows .spg.dnd .cst-cell.dnd-over { border-color: #e8b64a; box-shadow: 0 0 0 4px #e8b64a88; transform: scale(1.03); }
.cst-cell, .cst-bag { touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.sdnd-ghost .cst { transform: rotate(-4deg); }
