/* ui-fit.css — กันภาพยืด (Stamp 28 ต.ค.: "ปุ่มยืด" ยังไม่หาย + ไล่เช็คส่วนอื่น) · โหลดหลัง play.css
   หลัก: ภาพที่มีลายตรงขอบ (โคม/หัวม้วน/วงกลมไอคอน) ต้องล็อกหัวท้ายด้วย border-image หรือคุมสัดส่วนกล่องให้ตรงภาพ
   ไม่ใช้ background 100% 100% กับกล่องที่กว้างไม่แน่นอน */

/* ปุ่มเจนมาที่สัดส่วน ~2.7:1 — เดิมยืดเต็มการ์ด 336×50 (6.7:1) ดูเป็นแท่งยาว · ให้กว้างพอดีคำ ไม่ต่ำกว่า 230px อยู่กลาง */
.card > .btn { align-self: center; min-width: min(230px, 100%); }

/* ป้ายเลเวล: ภาพ 2:1 แต่กล่องเดิม 36×24 (1.5:1) บีบแบน · ขยายกว้างเป็น 48 แล้วเลื่อนซ้ายครึ่งหนึ่งให้กึ่งกลางเดิม */
.lvl { width: 48px; margin-left: -6px; }
/* Stamp 29 ต.ค. "เลเวลหลุดกรอบ ทับๆกัน": ป้ายเยื้องขวาล่างชนหัวใจหลอด EXP (หลอดใหม่ดึงซ้าย) → ย้ายกึ่งกลางใต้กรอบรูป อยู่หน้าหลอด · ตัวเลขเข้มบนพื้นครีม */
#me .lvl { left: 8px; top: 47px; margin-left: 0; z-index: 2; padding-top: 3px; box-sizing: border-box; color: #4a2e1f; font-size: 13px; font-weight: 700; line-height: 1; pointer-events: none; }
@media (max-height: 430px) { #me .lvl { left: 4px; top: 38px; width: 44px; height: 22px; font-size: 12px; } }

/* ป้าย Shatterday: ชิปเดิมยืดเต็มข้อความ (6.5:1 จากภาพ 3.2:1) หัวมนกลายเป็นวงรี · ล็อกหัวมนสองข้าง */
#evbadge { background: none; border-image: url(img/kit-chip.webp) 0 44 fill / 0 14px stretch; }
#evbadge.on { border-image: url(img/pill-kills.webp) 0 40 0 122 fill / 0 9px 0 28px stretch; }

/* ชิปเงิน (สูง 28/24): ช่องตัวเลขสั้นบีบหัวมน · ล็อกหัวมน · body นำหน้าให้ชนะสไตล์ที่ desk.js ฉีดเข้า <head> ทีหลัง */
body #info .cur { background: none; border-image: url(img/kit-chip.webp) 0 44 fill / 0 14px stretch; }
body #info .cur.sm { border-image-width: 0 12px; }

/* ชวนเข้าตี้: ป้ายไม้แบบเดียวกับ #toast — ล็อกหัวม้วนทองสองข้าง */

/* QA รอบ 4 (28 ต.ค.) ---------------------------------------------------------------- */
/* B4/G1 หน้าเปิดผลกาชา: พื้นหลังทึบ (ไม่เห็นแผงกาชาทะลุ) · อยู่เหนือแผงเสมอ · เว้นแถวให้ป้าย "ชีวิต ×2 · เทรดได้" ไม่ชนป้ายระดับแถวล่าง */
#reveal { background: rgba(18, 10, 6, .9); z-index: 13; }
#cards { row-gap: 36px; padding-top: 12px; }
.rc .new { padding: 0 6px; border-radius: 8px; background: rgba(42, 26, 16, .75); }

/* B5 ป้ายความสำเร็จทับหัวหน้าต่าง → มีหน้าต่าง/แผง/ผลกาชาเปิดอยู่ = ย้ายไปล่างจอ */
body:has(#modal:not([hidden])) #soc-ach, body:has(#panel:not([hidden])) #soc-ach, body:has(#reveal:not([hidden])) #soc-ach { top: auto; bottom: 18px; z-index: 16; }

/* G2/G3 ป้ายข้อความยาวล้นกรอบไม้ → ตัดบรรทัดในกรอบ (กรอบสูงตามข้อความ) */
#toast { white-space: normal; max-width: min(92vw, 620px); line-height: 1.35; }

/* U1 แนวนอนจอเตี้ย: แถบ ช่อง/แมป/กลับเมือง เคยเป็นแถวที่ 5 ของ HUD ซ้าย (สูงถึงกลางจอ ทับตัวละคร) → ย้ายไปแถวเล็กกลางจอบน ใต้นาฬิกาโล่ */
@media (max-height: 450px) {
  html body #zonechip { left: 50%; transform: translateX(-50%); top: 92px; gap: 4px; white-space: nowrap; }
  html body #zonechip button { font-size: 11px; padding: 3px 9px; }
}

/* UI audit 28 ต.ค. (00-HQ/outputs/2026-10-28-boojoo-ui-audit/report-shieldfall.md) ---------------------------- */
/* A1 เปิดกาชา 10 ใบ: เดิมแถวละ 4 = 3 แถว ล้นจอ 1280×720 → ปุ่ม "ตกลง" ตกขอบล่างโดนป้ายความสำเร็จบัง · ให้แถวละ 5 = 2 แถว */
#cards:not(.solo) { max-width: 820px; }
/* A2 ป้ายความสำเร็จ/ข้อความแจ้งเตือน ทับเนื้อหน้าต่าง (หน้าตาย/ผลกาชา) และปุ่มตกลง → ย้ายไปมุมบนจอ นอกกรอบหน้าต่าง */
body:has(#modal:not([hidden])) #soc-ach, body:has(#reveal:not([hidden])) #soc-ach { top: 8px; bottom: auto; left: auto; right: 12px; --tx: 0; transform: none; max-width: max(170px, calc(50vw - 250px)); }
body:has(#panel:not([hidden])) #toast { top: 8px; left: 12px; transform: none; min-width: 0; max-width: max(170px, calc(50vw - 376px)) !important; font-size: 13px; } /* QA รอบ 7 (social.js ตั้ง max-width !important ไว้): ป้ายประกาศ (กติกาชั้นสนาม ฯลฯ) ทับหัวหน้าต่าง Battle Pass/ร้าน → ไปมุมซ้ายบน นอกกรอบหน้าต่าง */
body:has(#modal:not([hidden])) #toast, body:has(#reveal:not([hidden])) #toast { top: 8px; left: 12px; transform: none; min-width: 0; max-width: max(170px, calc(50vw - 250px)) !important; font-size: 13px; }
body:has(#panel:not([hidden])) #toast.mid { top: 30%; left: 50%; transform: translateX(-50%); max-width: min(92vw, 620px) !important; font-size: 15px; }
@media (max-height: 450px) { body:has(#reveal:not([hidden])) #soc-ach, body:has(#reveal:not([hidden])) #toast { z-index: 12; } } /* จอเตี้ย: การ์ดเต็มจอ → ไว้ใต้ฉากผลกาชา (กลับมาเห็นหลังกดตกลง) */
/* A4 ป้ายระดับดาว: ขาวบนเทาอ่อน/ส้ม คอนทราสต์ 2.2–2.8 → เข้มขึ้นคงโทนสีเดิม */
.tier, .rc .rtier { background: color-mix(in srgb, var(--tc) 62%, #2a1a10); }
/* A5 ชิปกรองดาว (แผงอาชีพ): ดาวสีบนปุ่มไม้ อ่านไม่ออก → ขอบเข้ม */
#panel .chip span { text-shadow: 0 0 2px #2a1a10, 0 1px 0 #2a1a10, 0 0 1px #2a1a10; }
/* A6 โปรไฟล์ → ของแต่ง: หัวข้อกลางแต่ปุ่มชิดซ้าย (ไม่ตรงแนว) → หัวข้อชิดซ้ายเป็นหัวแถว */
#panel .soc-body > .rates:has(+ .soc-chips) { text-align: left; font-weight: 600; margin-bottom: -6px; }
/* A7 ตัวหนังสือ < 12px บนเดสก์ท็อป (นอก HUD ที่ zoom 1.3 แล้ว) */
@media (min-height: 451px) {
  #tut-say small { font-size: 12px; opacity: .8; }
  .gcl small { font-size: 12px; }
  .rc .rtier { font-size: 12px; }
  body #chatdock .tabs button { font-size: 12px; }
  body #chatdock .hd .ctx { font-size: 12px; }
}
/* A8 แนวนอนจอเตี้ย: ปุ่ม AUTO ทับปุ่มเมนูแถวล่าง (เสียง) · ฝนตั๋วทับปุ่มซูม/แผนที่ · แถบช่องทับแถบเงิน */
@media (max-height: 450px) {
  #menu { grid-template-columns: repeat(3, 44px); }
  html body #rainchip { left: auto !important; right: 160px; top: 65px !important; }
  html body #zonechip { top: 122px; }
  html body #partybox, html body #hud .qa { top: 154px; }
}
/* A9 เดสก์ท็อปจอเตี้ย (1280×720 · HUD zoom 1.3): ปุ่ม AUTO ทับปุ่ม "เสียง" แถวล่างของเมนู → เมนู 3 คอลัมน์ (สั้นลง 2 แถว) */
@media (min-height: 451px) and (max-height: 820px) and (min-width: 561px) { #menu { grid-template-columns: repeat(3, 56px); } }
/* A10 หน้าต่างเล็ก (#modal) เนื้อหายาวบนจอเตี้ย (ค่ายฟาร์ม/หน้าตาย บนมือถือแนวนอน): เนื้อหาล้นการ์ด ปุ่มตกลงทับบรรทัดล่าง → เลื่อนในกรอบแบบหน้าต่างกว้าง */
#modal .card #mbody { overflow: auto; min-height: 0; flex: 0 1 auto; padding-right: 4px; }
#modal .card #mbody > * { flex: none; }
#modal .card > #mok { flex: none; }

/* รอบ 2 กรอบ A (Stamp อนุมัติ 28 ต.ค. · 00-HQ/outputs/2026-10-28-boojoo-ui-audit/BRIEF-apply.md) ------------------------------
   ชิ้นเจน sf-a-*.webp จาก kit-a/shieldfall (ตัดจากแผ่น sf-a.png · ขอบยืดตาม manifest ÷2) · body นำหน้าให้ชนะสไตล์ที่ JS ฉีดทีหลัง */
/* SF-2 ป้ายหัวหน้าต่าง: ป้ายไม้ใหม่ อัญมณีโล่ลอยเหนือป้าย (ไม่จิ้มลงพื้นที่ตัวหนังสือ) · ป้ายไม่ยืดแนวตั้ง (ขอบ 22/8 = สัดส่วนภาพ) */
body #panel #ptitle { position: relative; min-width: 190px; margin: -50px auto 6px; padding: 0 14px; font-size: 19px; line-height: 26px; letter-spacing: .01em;
  border-style: solid; border-color: transparent; border-width: 22px 36px 8px; border-image: url(img/sf-a-title-plank.webp) 31 50 11 fill / 22px 36px 8px stretch; }
body #panel #ptitle::before { content: ''; position: absolute; left: 50%; top: -42px; width: 73px; height: 42px; transform: translateX(-50%); pointer-events: none;
  background: url(img/sf-a-title-gem.webp) center / 100% 100% no-repeat; }
@media (max-height: 450px) { /* จอเตี้ย: ป้ายเล็กลงสัดส่วนเดิม อัญมณีไม่หลุดขอบจอบน */
  body #panel #ptitle { margin-top: -30px; font-size: 16px; line-height: 19px; border-width: 17px 28px 6px; border-image-width: 17px 28px 6px; min-width: 150px; }
  body #panel #ptitle::before { top: -32px; width: 56px; height: 32px; } }
/* SF-2 แถวรายการร้าน (ตีบวก/อุปกรณ์/ยา/คราฟ/ตลาด/ห้องแชท): การ์ดครีมขอบทอง · ไอคอนในช่องไม้ · ชื่อหนา บรรทัดรองอ่านง่าย · ปุ่มชิดขวา */
/* รายการเป็นคอลัมน์ flex ไม่หด (แบบ grid เดิม แถวที่ข้อความ 3 บรรทัดถูกบีบเหลือ min-height ตัวหนังสือล้นกรอบ) */
body #panel .tshop, body #panel .soc-list { display: flex; flex-direction: column; gap: 10px; }
body #panel .tshop > *, body #panel .soc-list > * { flex-shrink: 0; }
body #panel .tshop .trow { gap: 12px; min-height: 66px; padding: 2px 6px 2px 2px; border: 12px solid transparent; border-image: url(img/sf-a-row.webp) 15 22 fill / 12px 16px stretch; outline: 0; }
body #panel .tshop .trow.sel { border-image: url(img/sf-a-row-q.webp) 22 30 fill / 13px 18px stretch; }
body #panel .tshop .trow > img { width: 56px; height: 56px; padding: 8px; box-sizing: border-box; object-fit: contain; background: url(img/sf-a-slot.webp) center / 100% 100% no-repeat; }
body #panel .tshop .trow .t { gap: 2px; }
body #panel .tshop .trow .t b, body #panel .soc-row .t b { font-size: 16px; line-height: 1.35; color: #4a2e1f; }
body #panel .tshop .trow .t small, body #panel .soc-row .t small { font-size: 13px; line-height: 1.4; opacity: 1; color: #6b4a2e; }
body #panel .tshop .trow > .btn { flex: none; min-width: 124px; min-height: 44px; font-size: 16px; --cap: 26px; }
/* ปุ่มในแถว: ไม่มีอัญมณีกลาง (ตามม็อกอัป) · หลัก = ส้ม · รอง = ฟ้า (ชิ้นเจนใหม่) */
body #panel .tshop .trow .btn, body #panel .soc-row .btn { background: none; }
body #panel .tshop .trow .btn img.gcoin, body #panel .rates img.gcoin { display: inline-block; flex: none; width: 18px; height: 18px; min-width: 0; margin: 0 3px -4px 0; padding: 0; background: none; border: 0; object-fit: contain; }
body #panel .tshop .trow .btn:not(.sub) { --bp: url(img/kit-btn-accent-plain.webp); color: #fff; text-shadow: 0 1px 0 #8a3a0a, 0 0 3px #8a3a0a; }
body #panel .tshop .trow .btn.sub { border-image: url(img/sf-a-btn-blue.webp) 0 38 fill / 0 var(--cap) stretch; color: #fff; text-shadow: 0 1px 0 #0b4a8a, 0 0 3px #0b4a8a; }
/* SF-3 ฉัน › ภารกิจ/ความสำเร็จ/เส้นทาง/Pass/อันดับ: แถวการ์ดครีม · แถวภารกิจขอบทองหนา · หลอดเข้ม+ไส้เขียว · ป้ายสถานะขวา */
body #panel .soc-list { gap: 8px; }
body #panel .soc-row { gap: 12px; min-height: 60px; padding: 2px 6px 2px 4px; border: 12px solid transparent; border-image: url(img/sf-a-row.webp) 15 22 fill / 12px 16px stretch; outline: 0; }
body #panel .soc-row.me, body #panel .soc-row.qrow { border-image: url(img/sf-a-row-q.webp) 22 30 fill / 13px 18px stretch; }
body #panel .soc-row > img { width: 44px; height: 44px; }
body #panel .soc-row .bar { --h: 14px; height: 14px; margin: 4px 0 0; padding: 3px 4px; border: 0; border-radius: 0; overflow: visible; box-sizing: border-box;
  background: none; border-style: solid; border-color: transparent; border-width: 0 9px; border-image: url(img/sf-a-track.webp) 0 14 fill / 0 9px stretch; }
body #panel .soc-row .bar i { display: block; height: 100%; min-width: 0; margin: 0 -6px; background: none; border-style: solid; border-color: transparent; border-width: 0 5px; box-sizing: border-box;
  border-image: url(img/sf-a-fill.webp) 0 12 fill / 0 5px stretch; }
body #panel .soc-row .bar i[style*="width:0%"] { visibility: hidden; }
body #panel .qbar { display: flex; align-items: center; gap: 10px; }
body #panel .qbar .bar { flex: 1; margin: 0; }
body #panel .qbar small { flex: none; min-width: 42px; font-weight: 600; font-variant-numeric: tabular-nums; }
body #panel .qst, body #panel .soc-row > span.rates { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 96px; min-height: 36px; padding: 0 6px; box-sizing: border-box;
  font-size: 15px; font-weight: 600; opacity: 1; color: #4d4d4d; text-shadow: 0 1px 0 #f4f4f4; border: solid transparent; border-width: 0 18px; border-image: url(img/sf-a-btn-grey.webp) 0 34 fill / 0 18px stretch; }
body #panel .qst { white-space: nowrap; } body #panel .soc-row > span.rates { white-space: nowrap; font-size: 14px; }
body #panel .qst.ok, body #panel .soc-row:not(.off) > span.rates { color: #fff; text-shadow: 0 1px 0 #2f6a0e, 0 0 3px #2f6a0e; border-image-source: url(img/sf-a-btn-green.webp); }
body #panel .soc-row .btn.small { min-width: 96px; min-height: 40px; font-size: 16px; }
body #panel .soc-row .btn.accent { color: #fff; text-shadow: 0 1px 0 #8a3a0a, 0 0 3px #8a3a0a; }
body #panel .lbl { font-size: 15px; color: #4a2e1f; margin-top: 2px; }
/* SF-1 HUD มือถือแนวนอน: แชทพับเป็นปุ่มไม้มุมซ้ายล่าง (partychat.js เริ่มแบบพับบนจอเตี้ย) · ป้ายตัวเลขยังไม่อ่านมุมขวาบน · ไม่โชว์ปุ่มคีย์บอร์ดบนจอสัมผัส */
body #chatdock .launch { position: relative; height: 40px; padding: 0 18px 0 8px; gap: 6px; font-size: 15px; border: solid transparent; border-width: 0 14px; background: none;
  border-image: url(img/kit-chip.webp) 0 44 fill / 0 14px stretch; }
body #chatdock .launch > img { width: 30px; height: 30px; margin-left: -10px; }
body #chatdock .launch .chat-badge { position: absolute; right: -14px; top: -8px; }
@media (pointer: coarse) { body #chatdock .launch kbd { display: none; } }
/* แนวตั้งจอแคบ: แถวไม่ล้นแนวนอน — ปุ่ม/ป้ายสถานะขึ้นบรรทัดใหม่ใต้ชื่อ */
@media (max-width: 560px) {
  body #panel .tshop { min-width: 0; }
  body #panel .tshop .trow, body #panel .soc-row { flex-wrap: wrap; row-gap: 6px; }
  body #panel .tshop .trow .t, body #panel .soc-row .t { flex: 1 1 130px; }
  body #panel .tshop .trow > .btn { flex: 1 1 100px; min-width: 0; }
  body #panel .qst, body #panel .soc-row > span.rates, body #panel .soc-row .btn.small { min-width: 80px; margin-left: auto; }
}
/* ตีบวก +10 (29 ต.ค.): ข้อความเสี่ยง · ส้ม = ล้มแล้วลดขั้น · แดง = ล้มแล้วแตก */
body #panel .tshop .urisk.dn { color: #b4570a; font-weight: 600; }
body #panel .tshop .urisk.br { color: #c0262d; font-weight: 700; }
/* A11 เมนูไอคอนกลืนกับฉาก (หญ้า/ดอกไม้/พื้นหิน) → แผ่นรองเจน chat-frame (น้ำตาลโปร่ง+ขอบทอง) หลังเมนูทั้งกลุ่ม · ขอบบนห้ามยื่นขึ้น (ทับมินิแมป) · ขวาเผื่อไว้ไม่ให้ขอบทองตกจอ · เฉพาะจอเดสก์ท็อป (มือถือเมนูชิดปุ่มสกิล/แถบล่าง แผ่นรองจะทับ) */
@media (min-width: 900px) and (min-height: 451px) { #menu { border: 12px solid transparent; border-image: url(img/chat-frame.webp) 40 fill / 12px stretch; padding: 2px 0 0; margin: 0 -4px 0 0; } }
/* หน้าต่างเต็มจอเว้นรอยบาก/ขอบโค้ง (Stamp 4 พ.ย. ตรวจ UI มือถือ: iPhone แนวนอนหัวข้อ ร้านตีบวก/โรงคราฟ/โถงกิลด์/ตลาด + ปุ่มชั้นดัน อยู่ใต้รอยบาก 62px) · ฉากพื้นหลังยังเต็มจอ เพราะพื้นอยู่ที่ #panel/#dun/#tw · html body = ชนะ padding: 0 ที่ไฟล์ js ฉีดทีหลัง */
html body #panel:has(.fpage), html body #panel:has(.guhall), html body #panel:has(.mkw) { padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
html body #dun .db { left: env(safe-area-inset-left, 0px); right: env(safe-area-inset-right, 0px); }
@media (pointer: coarse) { html body .mkw { padding-left: max(4px, env(safe-area-inset-left, 0px)); padding-right: max(4px, env(safe-area-inset-right, 0px)); } }
html body .fp-top .ttl { flex: none; white-space: nowrap; } /* "โรงคราฟ" เคยตัดเป็น 2 บรรทัดชิดขอบบน Android แนวนอน */
