/* เมนูแบบ B 4 หมวด (menu2.js + hud-bar.js layout2 · menu-tidy-1026) — html.menu2 เท่านั้น (?menu2=0 = แบบเดิม)
 * ผัง/ตำแหน่ง = JS วางแถวคอลัมน์ (inline grid-row/column) · ไฟล์นี้แค่หน้าตา: ป้ายหมวด · ลิงก์ ✎ จัดปุ่ม · จุดแดงที่ปุ่มแม่ · ช่องหัววงท่าทาง · ปุ่มสลับอันดับ⇄บอส
 * ตัวหนังสือใช้ --fs-* (ui-scale.css · ratchet ui-scale.test.js = 0) */

html.menu2 body #menu > .m2-tuck { display: none !important; }
html.menu2 body #menu > .m2-cat[hidden] { display: none !important; }
html.menu2 body #menu > .m2-cat {
  align-self: end; min-width: 0; padding: 0 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: 700 var(--fs-xs, 12px)/1.3 var(--font-head, var(--font)); letter-spacing: .02em; color: #8a6a34; pointer-events: none;
}
html.menu2 body #menu > .m2-cat[data-cat="more"] { border-top: 1px dashed #c9ad74; padding-top: 4px; }
html.menu2:not(.touch-ui) body #hud #menu > .m2-cat { color: #e9d3a0; }
html.menu2:not(.touch-ui) body #hud #menu > .m2-cat[data-cat="more"] { border-top-color: #e5c98c55; }

/* ✎ จัดปุ่ม = ลิงก์เล็กชิดขวาในแถวป้ายหมวดแรก (ไม่กินช่อง) — ยังแตะได้ ≥ 44px บนจอสัมผัส */
html.menu2 body #menu > button.m2-edit {
  justify-self: end; align-self: center; z-index: 1; width: auto; min-width: 0; height: auto; min-height: 30px; margin: -6px 0;
  display: inline-flex; flex-direction: row; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  border: 1px solid #c9ad74; background: #fff8e6; color: #6b4f22; box-shadow: none; cursor: pointer;
}
html.menu2 body #menu > button.m2-edit small { font: 600 var(--fs-xs, 12px)/1.2 var(--font); color: inherit; white-space: nowrap; }
html.menu2 body #menu > button.m2-edit .m2-pen { font-size: var(--fs-sm, 14px); line-height: 1; }
html.menu2 body #menu > button.m2-edit.on { background: linear-gradient(#e8c578, #c4903a); border-color: #a87a2c; }
html.menu2.touch-ui body #menu > button.m2-edit { min-height: 44px; margin: -12px 0 -8px; padding: 0 14px; background: #fff8e6; }
html.menu2:not(.touch-ui) body #hud #menu > button.m2-edit { height: auto; min-height: 26px; padding: 1px 8px; }

/* ปุ่มที่ย้ายไปเป็นแท็บ — จุดแดงขึ้นที่ปุ่มแม่ (ผู้เล่น · ตั้งค่า) หน้าตาเดียวกับ ui-badges.css */
html.menu2 body #menu > button.m2-attn:not(.attn)::after {
  content: ''; position: absolute; top: 3px; right: 3px; z-index: 1; width: 13px; height: 13px; border-radius: 999px;
  background: var(--bdg-red, #e8503a); box-shadow: 0 0 0 2px var(--bdg-rim, #fff2d8), 0 1px 3px #0005; pointer-events: none;
}

/* แผ่นเมนูจอสัมผัส: ช่องกว้างขึ้น (6 คอลัมน์แทน 11) — ตัวหนังสือไม่ต้องบีบ */
html.menu2.touch-ui body #menu { row-gap: 4px; }
html.menu2.touch-ui body #menu > button:not(.m2-edit) small { font-size: var(--fs-sm, 14px); }

/* หัววงท่าทาง: นั่งพัก · พักฟาร์ม (emote.js · ย้ายจากเมนู) — สองข้างของวง ไม่เปลี่ยนเลข 1–9 ของท่า */
#emote-wheel .ew-acts { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: calc(100% + 2 * var(--s) + 48px); display: flex; justify-content: space-between; pointer-events: none; }
#emote-wheel .ew-act {
  pointer-events: auto; width: calc(var(--s) + 14px); min-height: calc(var(--s) + 14px); padding: 6px 4px; border-radius: 16px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: linear-gradient(#fffbef, #ead9b5); border: 2px solid #e8b64a; box-shadow: 0 0 0 2px #7a4a1a, 0 4px 10px #0005; color: #3a2a12;
  animation: ewPop .16s ease-out both;
}
#emote-wheel .ew-act img { width: 34px; height: 34px; object-fit: contain; pointer-events: none; }
#emote-wheel .ew-act b { font: 600 var(--fs-xs, 12px)/1.15 var(--font, inherit); white-space: nowrap; }
#emote-wheel .ew-act:hover, #emote-wheel .ew-act:focus-visible { background: linear-gradient(#fff, #f6d58a); outline: none; }

/* อันดับ ⇄ กระดานบอส — สวิตช์สองช่องกว้างเท่ากัน แทนชื่อบนหัวหน้าต่าง (menu2.js bindRankBoss) · สองบานขนาด/ตำแหน่งเดียวกัน สลับแล้วไม่กระโดด
 *   ⚠️ ui-kit.css ".win > header button" (ปุ่มปิด 26px · ::before ขยายที่กด) โดนปุ่มในหัวทุกตัว → ล้างด้วย all: unset ก่อนแต่งใหม่ */
html.menu2 body #windows .win > header.m2-rbh > .win-t { display: none !important; }   /* ชื่อบานกว้างไม่เท่ากัน (Boss Board ≠ Rankings) = สวิตช์เลื่อน — สวิตช์บอกชื่ออยู่แล้ว */
html.menu2 body #windows .win > header.m2-rbh > .m2-rb { flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; margin: 0 8px 0 4px; }
html.menu2 body #windows .win > header.m2-rbh > .m2-rb > button {
  all: unset; box-sizing: border-box; flex: 1 1 0; min-width: 0; height: 34px; padding: 0 8px; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 1px solid #cdb581; background: linear-gradient(#fffbef, #ead9b5); color: #5a4218; font: 700 var(--fs-sm, 14px)/1 var(--font-head, var(--font));
}
html.menu2 body #windows .win > header.m2-rbh > .m2-rb > button::before { content: none; }
html.menu2 body #windows .win > header.m2-rbh > .m2-rb > button.on { background: linear-gradient(#e8c578, #c4903a); border-color: #a87a2c; color: #3a2a0c; }
html.menu2 body #windows .win > header.m2-rbh > .m2-rb > button:focus-visible { outline: 2px solid #2f6f73; outline-offset: 1px; }
html.menu2.touch-ui body #windows .win > header.m2-rbh > .m2-rb > button { height: 44px; }
/* จอสัมผัส: บานบอสเดิมเป็นแผงกลางกว้าง ≤ 600 (ระดับ b) ส่วนอันดับเต็มกว้าง (ui-touch.css จอเตี้ย) → ให้ทั้งสองเต็มกว้างเท่ากัน */
html.menu2.touch-ui body #windows .win:is([data-win="rank"], [data-win="mvp"])[data-level]:not([hidden]) {
  left: calc(var(--sa-l) + 8px) !important; right: calc(var(--sa-r) + 8px) !important;
}
/* คอม: กว้าง 480 สูงคงที่ทั้งสองบาน (เนื้อในเลื่อนเอง) — เดิม อันดับ 480 / บอส 400 สูงตามเนื้อหา */
html.menu2:not(.touch-ui) body #windows .win:is([data-win="rank"], [data-win="mvp"]) {
  box-sizing: border-box; width: var(--win-rb-w, min(480px, calc(100vw - 12px))) !important; height: min(calc(100vh - 110px), 660px) !important; max-height: none !important;
  display: flex; flex-direction: column;
}
html.menu2:not(.touch-ui) body #windows .win:is([data-win="rank"], [data-win="mvp"]) > header { flex: none; }
html.menu2:not(.touch-ui) body #windows .win:is([data-win="rank"], [data-win="mvp"]) > .body { flex: 1 1 auto; min-height: 0; max-height: none !important; overflow: auto; }
html.menu2:not(.touch-ui) body #windows .win:is([data-win="rank"], [data-win="mvp"]) > .foot { flex: none; }
