/* ระบบคู่หู (ใบ 186 · ทีม B) — ปุ่ม HUD · ปุ่ม "จับ" · ตัวเลขดาเมจคู่หู · สมุดหมวดคู่หู · ฉาก reveal
   ชั้น: ปุ่มอยู่ในกลุ่มเดิม (#touch-acts โซน br ของ ui-root.js / #hotbar คอม) · reveal = ชั้น Popup (--z-popup) เต็ม Safe Area
   ⚠️ ไม่มี animation infinite · ของที่เล่นครั้งเดียวอยู่ในฉาก reveal ที่ถอดทิ้งทั้งก้อนตอนปิด */
:root { --rk-C: #6fae4e; --rk-B: #4a8fd6; --rk-A: #8e5fd6; --rk-S: #e8b64a; }

/* ── ปุ่มคู่หู: หน้ามอน + วงคูลดาวน์ (conic ตั้งจาก JS) + กรอบหนัง/ทอง ── */
#pet-btn { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#pet-btn[hidden] { display: none; }
#pet-btn .pet-face { position: absolute; inset: 14%; border-radius: 50%; background: var(--pet-img) center / 118% no-repeat, radial-gradient(circle at 50% 40%, #fff8e6, #e9d6a8); }
#pet-btn .pet-cd { position: absolute; inset: 14%; border-radius: 50%; pointer-events: none;
  background: conic-gradient(rgba(24, 30, 40, .62) calc(var(--pet-cd, 0) * 360deg), transparent 0); }
#pet-btn .pet-frame { position: absolute; inset: 0; background: url('assets/ui/pet/btn_frame.webp') center / contain no-repeat; pointer-events: none; }
/* วงบางสี Rank ใต้กรอบ (C เขียว · B ฟ้า · A ม่วง · S ทอง) */
#pet-btn::before { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--rk, #6fae4e); box-sizing: border-box; pointer-events: none; }
#pet-btn .pet-pas { position: absolute; left: 50%; bottom: -3px; translate: -50% 0; padding: 1px 6px; border-radius: 8px; background: #2f6f73; color: #fff7e0; font: 700 10.5px/1.3 var(--font-head, inherit); font-style: normal; white-space: nowrap; }
#pet-btn .pet-key { position: absolute; right: -2px; top: -2px; min-width: 18px; height: 18px; border-radius: 6px; background: #2b2318e6; color: #f3e8ce; font: 700 11px/18px var(--font, inherit); text-align: center; }
#pet-btn.touch .pet-key { display: none; }
#pet-btn.pet-auto::after { content: 'A'; position: absolute; left: -3px; top: -3px; width: 18px; height: 18px; border-radius: 50%; background: #2f6f73; color: #fff; font: 700 10px/18px var(--font, inherit); text-align: center; border: 1.5px solid #e8b64a; }
#pet-btn.nope { animation: pet-nope .3s; }
@keyframes pet-nope { 25% { translate: -3px 0; } 75% { translate: 3px 0; } }
/* จอสัมผัส: บนวงปุ่มต่อสู้ ซ้ายบนของกล่อง #touch-acts (230×250 · พิกัดชุดเดียวกับ ui-touch.css) — ช่องว่างเหนือช่องสกิล 3 ไม่ทับจอย/ช่องสกิล/มินิแมพ */
html.touch-ui body #hud .hz-br > #touch-acts > #pet-btn.touch { position: absolute !important; left: auto !important; top: auto !important; right: 176px !important; bottom: 188px !important;
  width: 52px !important; height: 52px !important; margin: 0 !important; z-index: 1 !important; }
/* คอม: ไอคอนเล็กหัวแถวช่องลัด ถัดจากไม้ตาย */
html:not(.touch-ui) body #hotbar > #pet-btn { order: -1; position: relative; flex: 0 0 44px; width: 44px; height: 44px; margin: -4px 4px 0 0; align-self: flex-end; }

/* ── ปุ่ม "จับ" บนป้ายเป้าหมาย ──
   ปุ่มเป็นช่องที่ 3 ของกริด .t-body (คอลัมน์ขวา คร่อมแถวชื่อ+แถว HP) · ป้ายมีปุ่ม = .has-cap สูงตามปุ่ม (ปกติสูงตายตัว 34–38 overflow:hidden)
   ชื่อ · Lv · ธาตุ · HP ยังอยู่ครบ — ชื่อยาวตัดด้วย … ในคอลัมน์ซ้าย */
#target .t-cap { display: inline-flex; align-items: center; justify-content: center; gap: 4px; margin: 0; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 22px; box-sizing: border-box;
  border: 1.5px solid #e8b64a; background: linear-gradient(#3f8584, #2f6f73); color: #fff7e0; font: 700 14px/1 var(--font-head, inherit); white-space: nowrap; cursor: pointer; pointer-events: auto; }
#target .t-cap i { font-style: normal; }
#target .t-cap small { font-size: 11px; opacity: .85; }
#target .t-cap:active { scale: .95; }
html body #hud #target.mob.has-cap { height: auto; min-height: 38px; width: 380px; padding-bottom: 5px; }
#target.mob.has-cap .t-body { grid-template-columns: minmax(0, 1fr) auto auto; height: auto; }
#target.mob.has-cap .t-body > div:first-child { grid-column: 1; grid-row: 1; }
#target.mob.has-cap #t-info { grid-column: 2; grid-row: 1; }
html body #hud #target.mob.has-cap .rbar.hp { grid-column: 1 / 3; grid-row: 2; }
#target.mob .t-body > .t-cap { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
html:not(.touch-ui) #target .t-cap { min-height: 36px; }
/* จอสัมผัส: ป้ายกว้างขึ้นเท่าปุ่ม (ยังหดตามช่องโซนบนกลาง) · สูง 44+4 */
html.touch-ui body #hud .hz-tc #target.mob.has-cap { flex: 0 1 340px; height: auto; padding: 2px 3px 2px 9px; }
html.touch-ui #target .t-cap { padding: 0 10px; font-size: 13px; }

/* ── ตัวเลขดาเมจคู่หู (อ่อนกว่า ฟ้า-ครีม · เล็กกว่า) ── */
.dmg.pet { color: #bfe8e6; font-size: 17px; opacity: .92; text-shadow: 0 1px 2px #1a3a3c, 0 0 3px #1a3a3c; }

/* ── ป้าย Rank (ภาพเหรียญ) ── */
img.pet-rank { width: 30px; height: auto; vertical-align: middle; }
img.pet-rank.sm { width: 20px; }
img.pet-rank.big { width: 64px; }

/* ── สมุด: การ์ดมอน (อุ้งเท้า) · หมวดคู่หู ── */
.cx-paw { width: 15px; height: 15px; vertical-align: -3px; }
.pet-tabs button { min-height: 40px; }
.pet-goals { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; width: 100%; }
.pet-goal { padding: 4px 10px; border-radius: 12px; background: #fbf4e2; border: 1px solid #dcc898; font: 600 13px var(--font-head, inherit); color: #6b5530; }
.pet-goal.done { background: linear-gradient(#fff6dc, #f6e3b0); border-color: #c8901a; }
.cx-card.pet-c .cx-ic { position: relative; }
.cx-card.pet-c.unk .cx-mob { filter: brightness(0) opacity(.55); }
.cx-card.pet-c .pet-q { position: absolute; inset: 0; display: grid; place-items: center; font: 800 22px var(--font-head, inherit); color: #fff8e6; font-style: normal; text-shadow: 0 1px 2px #000a; }
.cx-card.pet-c .pet-skic { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 6px; border: 1px solid #e8b64a; background: #fff8e6; }
.cx-mob.pet-sil { filter: brightness(0) opacity(.5); }
/* ใบ 196: หัวโซนในกริดสมุด (เต็มแถว) + บรรทัด "เจอที่" ของการ์ดที่ยังไม่เคยจับ · ไม่มี animation */
.cx-grid > .pet-zh { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, auto) minmax(60px, 1fr) auto; align-items: center; gap: 4px 10px; padding: 7px 10px; margin-top: 4px; border-radius: 12px; background: #fbf4e2; border: 1px solid #dcc898; color: #6b5530; }
.pet-zh .pet-zn { font: 800 15px var(--font-head, inherit); display: flex; align-items: center; gap: 6px; }
.pet-zh .pet-zc { font: 800 14px var(--font-head, inherit); }
.pet-zh .pet-zr { grid-column: 1 / -1; font: 600 13px/1.3 var(--font, inherit); color: #7a6540; }
.pet-zh.done { background: linear-gradient(#fff6dc, #f6e3b0); border-color: #c8901a; }
.pet-zh.done .pet-zr { color: #8a5a00; }
.pet-zh .pet-stamp { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #c8901a; color: #fff8e6; font: 800 14px/1 var(--font-head, inherit); font-style: normal; transform: rotate(-12deg); box-shadow: 0 1px 2px #0004; }
.cx-card.pet-c .pet-at { display: block; max-width: 100%; font-size: 12px; line-height: 1.2; color: #7a6540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pet-strip { display: flex; gap: 2px; }
.pet-strip i { width: 15px; height: 13px; border-radius: 3px; background: #e6dcc4; color: #a8987a; font: 700 9.5px/13px var(--font, inherit); font-style: normal; text-align: center; }
.pet-strip i.on { background: var(--rk); color: #fff; }
.pet-panel { display: grid; gap: 8px; }
.pet-sk { display: flex; gap: 10px; align-items: flex-start; }
.pet-sk img.pet-skic { width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid #e8b64a; flex: none; }
.pet-sk.sm img.pet-skic { width: 28px; height: 28px; border-radius: 7px; }
.pet-sk.sm { align-items: center; font-size: 13px; }
.pet-pas-note { margin: 3px 0 0; font-size: 12.5px; line-height: 1.35; color: #2f6f73; font-weight: 700; }   /* สกิลติดตัวซ้ำ = เลเวลสูงสุด (claim-polish-1019) */
.pet-rrs { display: flex; flex-wrap: wrap; gap: 6px; }
.pet-rr { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 3px; border-radius: 10px; background: #fbf4e2; font: 600 12.5px var(--font, inherit); }
.pet-lines-info { margin: 0; padding-left: 18px; font-size: 13px; color: #5a4a30; }
.pet-rates summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; font: 700 13.5px var(--font-head, inherit); color: #6b4510; }
.pet-rt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pet-rt th, .pet-rt td { padding: 3px 4px; text-align: center; border-bottom: 1px solid #ecdfbf; }
.pet-meter { display: inline-block; width: 90px; height: 8px; border-radius: 4px; background: #e6dcc4; overflow: hidden; vertical-align: middle; }
.pet-meter i { display: block; height: 100%; background: linear-gradient(90deg, #3f8584, #e8b64a); }
.pet-got { display: inline-block; min-width: 24px; padding: 1px 5px; border-radius: 6px; background: #eee5cf; color: #a0906c; font: 700 12px var(--font, inherit); }
.pet-got.on { background: #2f6f73; color: #fff; }
.pet-mine { display: grid; gap: 10px; }
.pet-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 10px; border-radius: 14px; border: 2px solid #e2cc98; background: #fffaf0; }
.pet-card.rB { border-color: #8fb4e6; } .pet-card.rA { border-color: #b79ae0; } .pet-card.rS { border-color: #e8b64a; background: linear-gradient(#fffaf0, #fdf0cf); }
.pet-card.on { box-shadow: 0 0 0 3px #2f6f7355; }
.pet-pic { position: relative; }
.pet-pic .cx-mob { width: 96px; height: 96px; object-fit: contain; border-radius: 12px; background: radial-gradient(circle at 50% 45%, #fff8e6, #ecdcb4); }
.pet-pic img.pet-rank { position: absolute; left: -6px; top: -6px; width: 34px; }
.pet-info header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pet-info header b { font: 700 15px var(--font-head, inherit); }
.pet-nick-in { min-height: 36px; font-size: 15px; padding: 0 8px; border-radius: 8px; border: 1px solid #c8a86a; width: 10em; }
.pet-mini { min-width: 32px; min-height: 32px; border-radius: 8px; border: 1px solid #dcc898; background: #fbf4e2; cursor: pointer; }
.pet-lv { display: flex; align-items: center; gap: 6px; font: 600 13px var(--font, inherit); margin: 3px 0; }
.pet-lines { margin: 4px 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.pet-lines li { padding: 2px 8px; border-radius: 8px; background: #eef5f2; color: #24575a; font: 600 12.5px var(--font, inherit); }
.pet-lines li.lock { background: #eee9de; color: #9a8d74; }
/* สุ่มแถวใหม่ (C.5): แถว = ข้อความ + ปุ่ม 🎲 · พลิกแถวที่ได้ใหม่ครั้งเดียว 0.45 วิ (class มาจากการวาด ไม่สะสม) */
.pet-lines li { display: inline-flex; align-items: center; gap: 4px; padding-right: 3px; }
.pet-roll { min-width: 30px; min-height: 30px; padding: 0; border-radius: 8px; border: 1px solid #c9b27a; background: #fff8e6; font-size: 15px; line-height: 1; cursor: pointer; }
.pet-roll:active { scale: .92; }
.pet-roll.off { filter: grayscale(1); opacity: .45; cursor: not-allowed; }
.pet-roll.nope { animation: pet-nope .25s 1; }
html.touch-ui .pet-roll { min-width: 44px; min-height: 44px; font-size: 18px; }
.pet-lines li.flip { animation: pet-flip .45s ease-out 1; background: #fff2c8; }
@keyframes pet-flip { 0% { transform: perspective(300px) rotateX(90deg); } 60% { transform: perspective(300px) rotateX(-12deg); } 100% { transform: none; } }
.pet-roll-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; padding: 6px 8px; border-radius: 10px; background: #fff3d2; border: 1px solid #e8b64a; font: 600 12.5px var(--font, inherit); color: #5a3d10; }
.pet-roll-ask span { flex: 1 1 180px; }
.pet-roll-ask .cx-go { min-height: 40px; }
.pet-roll-ask .cx-go.main { background: linear-gradient(#3f8584, #2f6f73); color: #fff; border-color: #2f6f73; }
html.touch-ui .pet-roll-ask .cx-go { min-height: 44px; }
.pet-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.pet-acts .cx-go { min-height: 40px; }
.pet-acts .cx-go.main { background: linear-gradient(#3f8584, #2f6f73); color: #fff; border-color: #2f6f73; }
.pet-acts .cx-go.on { background: #2f6f73; color: #fff; }
.pet-acts .cx-go.bad { border-color: #c0705a; color: #a0402a; }
.pet-warn { font: 600 12.5px var(--font, inherit); color: #a0402a; }
html.touch-ui .pet-acts .cx-go, html.touch-ui .pet-tabs button, html.touch-ui .pet-mini { min-height: 44px; }
@container cxw (max-width: 860px) {
  .cx-mwrap[data-mt="pet"] .cx-mt[data-p="pet"] { display: block; }
  .pet-card { grid-template-columns: 72px minmax(0, 1fr); }
  .pet-pic .cx-mob { width: 72px; height: 72px; }
}

/* ── ฉากเปิดเผยตอนจับ (companion-reveal.js · รุ่น 2 REVEAL_V2 ทีม E 15 ต.ค.) — "พิธีลงทะเบียนคู่หู" ครีม parchment · teal · ทอง · มุมใบไม้
   คอม: กว้าง 55–65% จอ "หัว หัว / ภาพ ข้อมูล / ปุ่ม ปุ่ม" · มือถือแนวนอน (max-height 520): ซ้ายแคบ ~38% (หัว+แท่น) · ขวาเลื่อนได้ · ปุ่มติดล่างขวา
   ไม่มี animation infinite — ทุกอันเล่น 1 ครั้ง (สถานะค้างเป็นคลาส .sN ไม่ใช่ fill forwards) · DOM ถอดทั้งก้อนตอนปิด */
@property --prv-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
#pet-reveal { position: fixed; z-index: var(--z-popup, 300); inset: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; background: rgba(14, 22, 30, .6);
  padding: calc(var(--sa-t, 0px) + 12px) calc(var(--sa-r, 0px) + 12px) calc(var(--sa-b, 0px) + 12px) calc(var(--sa-l, 0px) + 12px); box-sizing: border-box; }
.prv { --rk: var(--rk-C); --glow: transparent; }
.prv.rB { --rk: var(--rk-B); --glow: #7fb4ffa0; }
.prv.rA { --rk: var(--rk-A); --glow: #b48cffb0; }
.prv.rS { --rk: var(--rk-S); --glow: #ffd36bc0; }
.prv-card { position: relative; width: min(clamp(760px, 60vw, 1180px), 100%); max-height: 100%; box-sizing: border-box; display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top top" "stage info" "acts acts";
  gap: 10px 26px; padding: 16px 34px 18px; border-radius: 24px; border: 2px solid #e8b64a;
  background: radial-gradient(ellipse at 50% 0%, #fffdf6 0%, transparent 60%), linear-gradient(#fffaf0, #f6e8c6);
  box-shadow: inset 0 0 0 6px #fffaf0, inset 0 0 0 7.5px #2f6f7333, 0 14px 40px #0007; }
.prv.rB .prv-card { border-color: #7fa8dc; } .prv.rA .prv-card { border-color: #a77ee0; }
.prv.rS .prv-card { border-color: #e8b64a; box-shadow: inset 0 0 0 6px #fffaf0, inset 0 0 0 7.5px #e8b64a66, 0 0 0 3px #e8b64a55, 0 14px 40px #0007; }
/* มุมใบไม้ (leaf_corner.webp วาดไว้มุมซ้ายบน · มุมอื่นพลิก) */
.prv-leaf { position: absolute; width: 74px; aspect-ratio: 154 / 160; background: url('assets/ui/pet/leaf_corner.webp') center / contain no-repeat; pointer-events: none; z-index: 1; }
.prv-leaf.tl { left: -6px; top: -6px; } .prv-leaf.tr { right: -6px; top: -6px; scale: -1 1; }
.prv-leaf.bl { left: -4px; bottom: -4px; width: 52px; scale: 1 -1; opacity: .8; } .prv-leaf.br { right: -4px; bottom: -4px; width: 52px; scale: -1 -1; opacity: .8; }
/* S: ขอบทองไหลวนรอบกรอบครั้งเดียว 1.6 วิ */
.prv-gold { position: absolute; inset: -3px; border-radius: 26px; padding: 4px; pointer-events: none; opacity: 0; z-index: 2;
  background: conic-gradient(from var(--prv-a), transparent 0 55%, #fff3c4 72%, #ffd36b 82%, #e8b64a 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.prv.rS.s3 .prv-gold { animation: prv-gold 1.6s ease-in-out 1; }
@keyframes prv-gold { 0% { --prv-a: 0deg; opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { --prv-a: 360deg; opacity: 0; } }
.prv.rS.s3 .prv-card { animation: prv-zoom .9s ease-out 1; }
@keyframes prv-zoom { 0% { scale: 1; } 35% { scale: 1.025; } 100% { scale: 1; } }

/* หัว: ป้ายผ้า + บรรทัดยินดี */
.prv-top { grid-area: top; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.prv-banner { width: 230px; max-width: 70%; aspect-ratio: 640 / 329; background: url('assets/ui/pet/banner_caught.webp') center / contain no-repeat;
  display: grid; place-items: center; scale: .4; opacity: 0; transition: scale .35s cubic-bezier(.3, 1.5, .5, 1), opacity .25s; }
.prv-banner span { margin-top: -6%; font: 800 24px/1 var(--font-head, inherit); color: #6b3d10; text-shadow: 0 1px 0 #fff6d8; white-space: nowrap; }
.prv-sub { margin: 0; display: flex; align-items: center; gap: 6px; font: 600 16px/1.35 var(--font, inherit); color: #5b4526; text-align: center; opacity: 0; transition: opacity .4s .25s; }
.prv-sub b { color: #2f6f73; }
.prv-sub img { width: 22px; height: 22px; flex: none; }
.prv-sub span { min-width: 0; }

/* ซ้าย: แท่น + มอน (container ขนาดจริง → ตำแหน่งตาม cqw/cqh) */
.prv-stage { grid-area: stage; position: relative; min-height: 300px; border-radius: 20px; overflow: hidden; container-type: size;
  background: radial-gradient(ellipse at 50% 78%, #fff6dc 0%, #eef2e4 50%, #d5e6dd 100%); box-shadow: inset 0 0 0 2px #2f6f7322; transition: box-shadow .6s; }
.prv.rB.s3 .prv-stage, .prv.rA.s3 .prv-stage, .prv.rS.s3 .prv-stage { box-shadow: inset 0 0 0 2px var(--rk), inset 0 0 22px var(--glow); }
.prv-glow { position: absolute; left: 50%; top: 44%; width: 92cqmin; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--glow) 0%, transparent 65%); opacity: 0; transition: opacity .8s; }
.prv-ring { position: absolute; left: 50%; top: 42%; width: 84cqmin; aspect-ratio: 512 / 482; translate: -50% -50%; pointer-events: none;
  background: url('assets/ui/pet/seal_ring.webp') center / contain no-repeat; scale: .3; opacity: 0; transition: scale .7s ease, opacity .5s; }
.prv-ped { position: absolute; left: 50%; bottom: 4cqh; width: min(78cqw, 96cqh); aspect-ratio: 512 / 382; translate: -50% 0; pointer-events: none;
  background: url('assets/ui/pet/pedestal.webp') center / contain no-repeat; filter: drop-shadow(0 6px 6px #2f3f3a33); }
.prv-sring { position: absolute; left: 50%; top: 42%; width: 74cqmin; aspect-ratio: 477 / 512; translate: -50% -50%; background: url('assets/ui/pet/s_ring.webp') center / contain no-repeat;
  scale: .6; opacity: 0; pointer-events: none; filter: drop-shadow(0 0 10px #ffe39a); }
.prv-spk { position: absolute; inset: 0; pointer-events: none; opacity: 0;   /* ประกาย 8 จุด เล่นครั้งเดียวตอน .s3 (S 1.2 วิ ทอง · A 0.6 วิ ม่วง · B ฟ้านุ่ม) */
  background: radial-gradient(circle at 20% 30%, #fff 0 4px, var(--spc, #fff) 5px, transparent 17px), radial-gradient(circle at 78% 24%, #fff 0 4px, var(--spc, #fff) 5px, transparent 17px), radial-gradient(circle at 64% 72%, #fff 0 3px, var(--spc, #fff) 4px, transparent 14px), radial-gradient(circle at 30% 76%, #fff 0 3px, var(--spc, #fff) 4px, transparent 14px), radial-gradient(circle at 50% 12%, #fff 0 4px, var(--spc, #fff) 5px, transparent 17px), radial-gradient(circle at 12% 54%, #fff 0 4px, var(--spc, #fff) 6px, transparent 20px), radial-gradient(circle at 88% 52%, #fff 0 4px, var(--spc, #fff) 6px, transparent 20px), radial-gradient(circle at 70% 40%, #fff 0 3px, var(--spc, #fff) 4px, transparent 12px); }
/* มอนยืนบนหน้าแท่น (หน้าแท่น ≈ 60% ของความสูงภาพแท่นจากล่าง) */
.prv-mob { position: absolute; left: 50%; bottom: calc(4cqh + min(78cqw, 96cqh) * 382 / 512 * .5); width: min(64cqw, 62cqh); translate: -50% 0; transform-origin: 50% 90%;
  transition: transform .5s ease, opacity .5s; filter: drop-shadow(0 6px 6px #0003); }
.prv-seal { position: absolute; left: -20%; bottom: 60%; width: 22%; transition: left .6s ease, bottom .6s ease, filter .4s, opacity .4s; }
.prv-stage .prv-coin-m { display: none; position: absolute; left: 6px; top: 6px; z-index: 1; }

/* ขวา: ข้อมูล */
.prv-info { grid-area: info; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 2px 4px 2px 0; }
.prv-head { display: flex; gap: 14px; align-items: center; }
.prv-flip { display: inline-block; flex: none; transform: rotateY(90deg); opacity: 0; transition: transform .4s ease, opacity .2s; }
.prv-coin img.pet-rank.big { width: 76px; filter: drop-shadow(0 3px 4px #0003); }
.prv-id { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.prv-name { display: block; font: 800 26px/1.15 var(--font-head, inherit); color: #4a3418; overflow-wrap: anywhere; }
.prv-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; opacity: 0; transition: opacity .3s; }
.prv-lv { padding: 2px 12px; border-radius: 11px; background: #2f6f73; color: #fff; font: 800 15px var(--font-head, inherit); }
.prv-role { padding: 2px 10px; border-radius: 11px; background: #fff6e0; border: 1.5px solid #e8b64a; color: #6b4a14; font: 700 14px var(--font, inherit); }
/* 3 แถวโบนัส: pill · ขีดสี Rank ซ้าย · ไอคอน · ชื่อค่า · ค่าตัวหนา · ป้ายโรลดี/ปลดที่ Lv */
.prv-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.prv-ln { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 5px 12px 5px 10px; box-sizing: border-box; border-radius: 14px; border-left: 5px solid var(--rk);
  background: linear-gradient(90deg, #eef5f2, #f7f8f0); color: #24575a; font: 700 15px var(--font, inherit); box-shadow: 0 1px 0 #2f6f7318;
  opacity: 0; translate: 12px 0; transition: opacity .25s, translate .25s; transition-delay: calc(var(--i) * .3s); }
.prv-lic { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fffaf0; box-shadow: 0 0 0 1.5px #2f6f7333; }
.prv-lic img.ui-ic { width: 20px; height: 20px; margin: 0; vertical-align: 0; }
.prv-lk { flex: 1; min-width: 0; }
.prv-lval { font: 800 18px var(--font-head, inherit); color: #1f4b4e; }
.prv-ln.lock { border-left-color: #c9bfa8; background: #f1ece0; color: #8a7e66; }
.prv-ln.lock .prv-lval { color: #9a8f78; }
.prv-ul { font: 700 12.5px var(--font, inherit); color: #8a7e66; white-space: nowrap; }
.prv-good { font-style: normal; white-space: nowrap; padding: 1px 8px; border-radius: 9px; background: linear-gradient(#f6d27a, #e8b64a); color: #4a2e08; font: 800 12.5px var(--font, inherit); box-shadow: 0 1px 0 #b98a2a; }
/* การ์ดสกิล */
.prv-sk { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: #fffdf6; border: 2px solid #e8d5a4; box-shadow: 0 2px 0 #e2cf9e;
  opacity: 0; transition: opacity .3s; }
.prv-skic { flex: none; width: 56px; height: 56px; border-radius: 14px; border: 2px solid #e8b64a; background: #2f6f73; }
.prv-skb { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prv-skn { font: 800 18px var(--font-head, inherit); color: #4a3418; }
.prv-skd { font: 500 14px var(--font, inherit); color: #6a5a40; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prv-skl { font: 700 15px var(--font, inherit); color: #2f6f73; margin-top: 2px; }
.prv-skl b { font: 800 22px var(--font-head, inherit); color: #1f4b4e; }
.prv-skl small { font: 700 15px var(--font-head, inherit); color: #6a7d7a; }
.prv.rS .prv-skl b { text-decoration: underline 3px #e8b64a; text-underline-offset: 4px; }
.prv-skr { font: 600 14px var(--font, inherit); color: #6a5a40; }
.prv-skf { font: 500 12.5px var(--font, inherit); color: #8a7a5c; }
/* สมุด */
.prv-book { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border-radius: 14px; background: #f4ecd6; opacity: 0; transition: opacity .3s; }
.prv-zone { display: flex; align-items: center; gap: 8px; font: 700 14.5px var(--font, inherit); color: #4a3418; }
.prv-zone .pet-meter { flex: 1; height: 10px; min-width: 60px; }
.prv-rs { margin: 0; display: flex; align-items: center; gap: 6px; font: 500 14px var(--font, inherit); color: #5b4a30; }
.prv-rs b { color: #2f6f73; }
.prv-tipb { flex: none; width: 30px; height: 30px; min-width: 30px; min-height: 30px; border-radius: 50%; border: 1.5px solid #2f6f73; background: #fffaf0; color: #2f6f73; font: italic 800 14px/1 Georgia, serif; cursor: pointer; padding: 0; }
.prv-tip { margin: 0; padding: 6px 10px; border-radius: 10px; background: #fffaf0; border: 1px dashed #c9b27a; font: 500 13.5px var(--font, inherit); color: #5b4a30; }
/* ปุ่ม */
.prv-acts { grid-area: acts; display: flex; justify-content: center; gap: 14px; opacity: 0; pointer-events: none; transition: opacity .3s; }
.prv-acts button { flex: 0 1 300px; min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 16px;
  font: 800 17px var(--font-head, inherit); cursor: pointer; border: 2px solid #2f6f73; }
.prv-set { background: linear-gradient(#3f8584, #2f6f73); color: #fff8e6; box-shadow: 0 3px 0 #1f4b4e; }
.prv-set img { width: 26px; height: 26px; }
.prv-keep { background: #fffaf0; color: #2f6f73; box-shadow: 0 3px 0 #c9b27a; }
/* ขั้น (คลาส s1–s7 ใส่ตามเวลา) */
.prv.s1 .prv-seal { left: 39%; bottom: 40%; filter: drop-shadow(0 0 10px #fff3c4); }
.prv.s1 .prv-ring { scale: 1; opacity: .5; transition-delay: .5s; }
.prv.s1 .prv-mob { transform: scale(.05) translateY(-40%); opacity: 0; transition-delay: .6s; }
.prv.s2 .prv-seal { opacity: 0; }
.prv.s2 .prv-mob { transform: none; opacity: 1; transition-delay: 0s; animation: prv-hop .5s ease-out .15s 1; }
.prv.s2 .prv-banner { scale: 1; opacity: 1; }
.prv.s2 .prv-sub { opacity: 1; }
.prv.s2 .prv-ring { scale: 1; opacity: .22; }
.prv.s3 .prv-flip { transform: none; opacity: 1; }
.prv.s3 .prv-glow { opacity: 1; }
.prv.s4 .prv-meta { opacity: 1; }
.prv.s5 .prv-ln { opacity: 1; translate: 0 0; }
.prv.s6 .prv-sk { opacity: 1; }
.prv.s7 .prv-book { opacity: 1; }
.prv.s7 .prv-acts { opacity: 1; pointer-events: auto; }
.prv.rS.s3 .prv-sring { scale: 1; opacity: .55; animation: prv-sring 1.2s cubic-bezier(.2, .9, .3, 1.1) 1; }
.prv.rS.s3 .prv-spk, .prv.rA.s3 .prv-spk, .prv.rB.s3 .prv-spk { animation: prv-spk 1.2s ease-out 1; }
.prv.rB .prv-spk { --spc: #9cc8ff; } .prv.rA .prv-spk { --spc: #b48cff; } .prv.rS .prv-spk { --spc: #f6c94a; }
.prv.rA.s3 .prv-spk { animation-duration: .8s; }
.prv.rA.s3 .prv-spk, .prv.rS.s3 .prv-spk { opacity: .5; }   /* ประกายเล็กค้างนิ่ง (A/S) — ไม่ใช่ animation วนซ้ำ */
.prv.rB.s3 .prv-spk { opacity: .3; } .prv.rB.s3 .prv-spk { animation-duration: .7s; }
@keyframes prv-hop { 0% { translate: -50% 0; } 40% { translate: -50% -14%; } 70% { translate: -50% 0; } 85% { translate: -50% -4%; } 100% { translate: -50% 0; } }
@keyframes prv-sring { 0% { scale: .6; opacity: 0; } 40% { opacity: 1; } 75% { scale: 1.08; opacity: .9; } 100% { scale: 1; opacity: .55; } }   /* หัวหน้า 15 ต.ค.: วงใหญ่/จัดเกินโทน cozy — ลดขนาดและความทึบตอนค้าง */
@keyframes prv-spk { 0% { opacity: 0; scale: .7; } 25% { opacity: 1; } 60% { opacity: 1; scale: 1.05; } 100% { opacity: 0; scale: 1.15; } }
/* คอมจอใหญ่ */
@media (min-width: 1700px) and (min-height: 900px) {
  .prv-card { padding: 28px 44px 30px; gap: 18px 34px; }
  .prv-leaf.tl, .prv-leaf.tr { width: 92px; }
  .prv-banner { width: 300px; } .prv-banner span { font-size: 30px; }
  .prv-sub { font-size: 18px; }
  .prv-coin img.pet-rank.big { width: 96px; }
  .prv-name { font-size: 30px; }
  .prv-ln { min-height: 46px; font-size: 16.5px; } .prv-lval { font-size: 20px; }
  .prv-skic { width: 64px; height: 64px; }
  .prv-skn { font-size: 21px; } .prv-skd, .prv-skr { font-size: 16px; } .prv-skl { font-size: 17px; } .prv-skl b { font-size: 26px; } .prv-skf { font-size: 14px; }
  .prv-zone { font-size: 16px; } .prv-rs { font-size: 15.5px; } .prv-tip { font-size: 15px; }
  .prv-acts button { min-height: 60px; font-size: 19px; flex-basis: 340px; }
}
/* มือถือแนวนอน (จอเตี้ย) — ห้ามย่อแบบคอม: ซ้ายแคบ ~38% (ป้าย + แท่น + เหรียญทับมุม) · ขวาเลื่อนได้ · ปุ่มติดล่างขวา ≥ 48px */
@media (max-height: 520px) {
  #pet-reveal { padding: calc(var(--sa-t, 0px) + 6px) calc(var(--sa-r, 0px) + 8px) calc(var(--sa-b, 0px) + 6px) calc(var(--sa-l, 0px) + 8px); }
  .prv-card { width: 100%; height: 100%; grid-template-columns: minmax(0, 38fr) minmax(0, 62fr); grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "top info" "stage info" "stage acts"; gap: 6px 14px; padding: 10px 14px 10px 12px; border-radius: 18px; }
  .prv-leaf.tl, .prv-leaf.tr { width: 46px; } .prv-leaf.bl, .prv-leaf.br { width: 34px; }
  .prv-leaf.tr, .prv-leaf.br { display: none; }   /* มือถือ: มุมขวาชนชื่อ/ปุ่ม — เหลือใบไม้มุมซ้าย */
  .prv-banner { width: auto; height: 54px; max-width: 100%; }
  .prv-banner span { font-size: 18px; }
  .prv-sub { font-size: 14px; line-height: 1.3; gap: 4px; }
  .prv-sub img { width: 18px; height: 18px; }
  .prv-stage { min-height: 0; border-radius: 14px; }
  .prv-stage .prv-coin-m { display: inline-block; }
  .prv-coin-m img.pet-rank.big { width: 60px; filter: drop-shadow(0 2px 3px #0003); }
  .prv-coin { display: none; }
  .prv-info { gap: 8px; padding-top: 4px; }
  .prv-name { font-size: 20px; }
  .prv-id { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .prv-lv { font-size: 14px; } .prv-role { font-size: 14px; }
  .prv-lines { gap: 5px; }
  .prv-ln { min-height: 34px; padding: 3px 10px 3px 8px; font-size: 14px; border-radius: 12px; }
  .prv-lic { width: 24px; height: 24px; } .prv-lic img.ui-ic { width: 17px; height: 17px; }
  .prv-lval { font-size: 16px; }
  .prv-sk { padding: 8px 10px; gap: 10px; border-radius: 14px; }
  .prv-skic { width: 52px; height: 52px; }
  .prv-skn { font-size: 16px; } .prv-skl b { font-size: 19px; }
  .prv-book { padding: 6px 10px; }
  .prv-acts { gap: 10px; padding-top: 2px; }
  .prv-acts button { flex: 1 1 0; min-height: 50px; font-size: 15px; border-radius: 14px; padding: 0 8px; }
  .prv-set img { width: 22px; height: 22px; }
}
@media (max-height: 360px) {   /* 740×340: แถวแน่นขึ้นให้การ์ดสกิลโผล่ก่อนเลื่อน (ตัวหนังสือไทยยัง ≥ 14px) */
  .prv-banner { height: 46px; }
  .prv-sub { font-size: 14px; line-height: 1.25; }
  .prv-info { gap: 6px; }
  .prv-name { font-size: 18px; }
  .prv-lines { gap: 4px; }
  .prv-ln { min-height: 30px; padding-block: 2px; }
  .prv-sk { padding: 6px 10px; }
  .prv-skic { width: 48px; height: 48px; }
  .prv-acts button { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) { #pet-reveal * { transition: none !important; animation: none !important; } }

/* ── ป้ายชื่อคู่หูเหนือหัว (CSS2D ระบบป้ายเดิม) ── */
.label.pet-lab { pointer-events: none; }
.pet-tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 2px; border-radius: 9px; background: rgba(30, 38, 44, .55);
  color: #fff6e0; font: 700 11.5px/1.3 var(--font-head, inherit); white-space: nowrap; text-shadow: 0 1px 2px #000a; border: 1px solid var(--rk-C); }
.pet-tag img { width: 16px; height: 16px; object-fit: contain; }
/* คู่หูของคนอื่น: เหรียญ Rank อย่างเดียว ไม่มีพื้น/ชื่อ (companion.js · ผู้ใช้ 15 ต.ค. ป้ายรก) */
.pet-tag.pet-coin { padding: 0; background: none; border: 0; box-shadow: none; }
.pet-tag.pet-coin img { width: 14px; height: 14px; filter: drop-shadow(0 1px 1px #0008); }
.pet-tag.rB { border-color: var(--rk-B); } .pet-tag.rA { border-color: var(--rk-A); } .pet-tag.rS { border-color: var(--rk-S); color: #ffe7a6; }

/* ฉาก "กำลังจับ" ในโลก 3D (capture-fx.js · ทีม D 15 ต.ค.) — ปุ่มข้ามมุมล่างขวา โผล่หลัง 2 วิ · 44px · ไม่มี animation (transition ครั้งเดียว) */
.cap-skip { position: fixed; right: calc(16px + var(--sa-r, env(safe-area-inset-right, 0px))); bottom: calc(16px + var(--sa-b, env(safe-area-inset-bottom, 0px)));
  z-index: var(--z-popup, 300); min-width: 88px; min-height: 44px; padding: 0 18px; border-radius: 22px; border: 2px solid #2f6f73;
  background: #fffaf0e6; color: #2f6f73; font: 800 15px var(--font-head, inherit); cursor: pointer; box-shadow: 0 3px 10px #0003;
  opacity: 0; pointer-events: none; transition: opacity .3s; }
.cap-skip.on { opacity: 1; pointer-events: auto; }
/* มาจากฉากจับในโลก (from3d): ไม่โชว์ตราบินซ้ำ · มอนไม่หดหายก่อน (ขั้น ② ตามมาใน 0.2 วิ) */
.prv.from3d .prv-seal { display: none; }
.prv.from3d:not(.s2) .prv-mob { transform: scale(.6); opacity: 0; transition-delay: 0s; }
/* กลีบโปรยตอนเผย A/S (companion-reveal.js petals) — เล่นครั้งเดียว 2 วิ · สถานะพื้น opacity 0 (ไม่ใช้ fill forwards) · ชั้นถูกถอดหลัง 3 วิ */
.prv-card { position: relative; }
.prv-petals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
.prv-petals i { position: absolute; top: -40px; background: url('assets/ui/pet/petals.webp') no-repeat; opacity: 0; animation: prv-fall 2s ease-in 1; }
@keyframes prv-fall { 0% { opacity: 0; transform: translate(0, 0) rotate(0); } 12% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), 340px) rotate(var(--r)); } }
@media (prefers-reduced-motion: reduce) { .prv-petals { display: none; } }
/* จอสัมผัส: ปุ่มข้ามย้ายไปขวาบนใต้มินิแมพ (ล่างขวาทับป้าย EXP/ใกล้ปุ่มตี · หัวหน้า 15 ต.ค.) — --hz-tr-b = ขอบล่างโซนขวาบนจาก ui-root.js */
html.touch-ui .cap-skip { bottom: auto; top: calc(var(--hz-tr-b, 110px) + 10px); }

/* 15 ต.ค. (ผู้ใช้: สมุดหมวดคู่หูบนมือถือเพี้ยน — แถวค้นหา/ชิปลอยกลาง ตารางถูกดันลงล่างจนตัด)
 *   สาเหตุ: หน้าต่างแคบ (≤ 860) แถวตัวกรองเป็นแถวเดียวเลื่อนข้าง แต่ .pet-goals กว้าง 100% + ตัดบรรทัด และ .pet-tabs ซ้อนใน .cx-chips
 *   ทำให้แถวที่ 1 ของกริดสูงเกินจริง → ชิปเป้าหมายต่อท้ายแถวเดียวกัน ไม่ตัดบรรทัด · แท็บย่อยแตกออกเป็นปุ่มในแถว */
@container cxw (max-width: 860px) {
  .cx-main > .cx-filter .pet-tabs { display: contents; }
  .cx-main > .cx-filter .pet-goals { display: contents; }
  .cx-main > .cx-filter .pet-goal { flex: none; white-space: nowrap; }
}
/* จอเตี้ย (มือถือแนวนอนรุ่นใหญ่ที่หน้าต่างกว้าง > 860 จึงยังเป็นแบบ 3 ส่วน): หัวหมวด + แท็บ + ตัวกรอง + เป้าโซน รวมเป็นแถวเดียวเลื่อนข้าง ไม่กิน 4 แถว */
@media (max-height: 520px) {   /* 3 พ.ย.: ใช้ [data-cx="pet"] แทน :has(.pet-tabs) — :has + ปุ่มทั้งหน้า (การ์ด 88 ใบ) = Chrome คิดสไตล์ซ้ำทุกครั้งที่ DOM/คลาสรูปเปลี่ยน (perf.md 4b) */
  .cx[data-cx="pet"] .cx-main .cx-title { display: none; }
  .cx[data-cx="pet"] .cx-main > .cx-filter { display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none; min-width: 0; padding-bottom: 2px; }
  .cx[data-cx="pet"] .cx-main > .cx-filter::-webkit-scrollbar { display: none; }
  .cx[data-cx="pet"] .cx-main > .cx-filter > :is(.cx-chips, .pet-goals) { display: contents; }
  .cx[data-cx="pet"] .cx-main > .cx-filter .pet-goal, .cx[data-cx="pet"] .cx-main > .cx-filter .cx-chips button { flex: none; white-space: nowrap; }
}
/* สมุดคู่หู 88 ใบบนมือถือเล็ก (2 พ.ย. ผู้เล่นแจ้งค้าง): การ์ดนอกจอไม่ต้องวาด + ช่องรูปที่ยังไม่โหลดไม่วนเงา shimmer ไม่สิ้นสุด (80+ ช่องวาดซ้ำทุกเฟรม) */
.cx-card.pet-c { content-visibility: auto; contain-intrinsic-size: auto 132px; }
.cx-card.pet-c .cx-ic:has(> img.cx-wait), .pet-pic:has(> img.cx-wait) { animation: none; background: #efe4c9; }

/* ── อุปกรณ์คู่หู (ใบ 201 · companion-gear.js) — ป๊อปอัป 2 ช่อง แบบหน้าสวมใส่ของคน · กระดาษครีม ขอบทอง ── */
.pet-acts .pet-gear-btn small { font-weight: 800; color: #ffe7a8; }
dialog.pg-sheet { width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 16px); padding: 12px 14px; border: 2px solid #e8b64a; border-radius: 16px; background: #fbf4e2; color: #3b2a14; overflow: hidden; display: flex; flex-direction: column; gap: 8px; }
dialog.pg-sheet::backdrop { background: rgba(60, 40, 10, .35); }
/* ⚠️ bug 16 ต.ค. (มือถือแนวนอน: ป๊อปอัปชิดขอบล่าง เหลือแค่หัว ช่อง/กระเป๋า/ปุ่มตกขอบจอ) — สาเหตุ: กฎกลาง .sheet
   ของจอสัมผัส (ui-kit.css "แผ่นชิดขอบล่าง" + ui-polish.css max-height: 100dvh − 32 − --kb) ชนะ dialog.pg-sheet ด้วย specificity
   → ป๊อปอัปเกาะขอบล่าง สูงตามเนื้อ (max-content) และเมื่อ --kb ค้าง ~280px ความสูงเหลือ ~84px · .pg-body เป็น flex:1 + min-height:0
   จึงถูกบีบเหลือ 0 แล้ว overflow:hidden ตัดทิ้ง · แก้: ป๊อปอัปนี้อยู่กลางจอทุกขนาด ความสูงไม่เกิน Safe Area ไม่หัก --kb (ไม่มีช่องพิมพ์)
   หัว (ปุ่มปิด) คงที่ เนื้อเลื่อนในตัว · ห้ามลบ :root body (ต้องชนะ html.touch-ui body .sheet) */
:root body dialog.sheet.pg-sheet {
  inset: 0; margin: auto; height: fit-content;
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px - var(--sa-t, 0px) - var(--sa-b, 0px));
  min-height: min(220px, calc(100dvh - 16px));
}
:root body dialog.sheet.pg-sheet .pg-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.pg-sheet .pg-head { display: flex; align-items: center; gap: 8px; position: relative; flex: none; }
.pg-sheet .pg-mob { width: 44px; height: 44px; object-fit: contain; border-radius: 12px; background: #fff; border: 1px solid #e3d3a8; }
.pg-sheet .pg-rk { width: 26px; height: 26px; margin-left: -18px; align-self: flex-end; }
.pg-sheet .pg-ttl { flex: 1; min-width: 0; display: grid; }
.pg-sheet .pg-ttl b { font-size: 16px; }
.pg-sheet .pg-ttl small { color: #6b5a38; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-sheet .pg-x { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid #d8c49a; background: #fffaf0; font-size: 22px; line-height: 1; color: #6b5a38; cursor: pointer; }
.pg-sheet .pg-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; min-height: 0; flex: 1; }
.pg-sheet .pg-left, .pg-sheet .pg-right { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.pg-sheet .pg-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pg-sheet .eqslot.pg-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 96px; padding: 6px 4px; border-radius: 14px; border: 1.5px solid #d8c49a; background: radial-gradient(circle at 50% 35%, #fffdf6, #f3e6c4); box-shadow: 0 2px 0 #e3d3a8; font-size: 12px; text-align: center; cursor: pointer; }
.pg-sheet .eqslot.pg-slot.empty { border: 1.5px dashed #cdbc98; background: #f7f0e1; box-shadow: none; color: #8a7a58; }
.pg-sheet .eqslot.pg-slot.empty .pg-ic { opacity: .45; filter: grayscale(.5); }
.pg-sheet .eqslot.pg-slot.sel { border: 2px solid #2f6f73; background: radial-gradient(circle at 50% 35%, #f3fbf9, #cfe8e4); box-shadow: 0 0 0 3px #2f6f7340; }
.pg-sheet .eqslot.pg-slot.r-good { border-bottom: 3px solid #2f8ae0; } .pg-sheet .eqslot.pg-slot.r-rare { border-bottom: 3px solid #9a4ae8; } .pg-sheet .eqslot.pg-slot.r-epic { border-bottom: 3px solid #e8a82a; }
.pg-sheet .pg-ic { width: 48px; height: 48px; display: grid; place-items: center; font-size: 30px; }
.pg-sheet .pg-ic img { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(60, 40, 10, .25)); }
.pg-sheet .pg-lab { font-weight: 800; color: #6b5a38; font-size: 12px; }
.pg-sheet .pg-nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: #3b2a14; }
.pg-sheet .pg-sum { padding: 8px 10px; border-radius: 12px; background: #fff8e8; border: 1.5px solid #e6d3a6; font-size: 13px; }
.pg-sheet .pg-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: baseline; padding: 2px 0; }
.pg-sheet .pg-row i { font-style: normal; color: #6b5a38; }
.pg-sheet .pg-row b { text-align: right; color: #2f6f73; }
.pg-sheet .pg-row.main b { font-size: 16px; color: #2f8a3a; }
.pg-sheet .pg-bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: #eadfc2; overflow: hidden; }
.pg-sheet .pg-bar em { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #5cb86a, #e8b64a); }
.pg-sheet .pg-row small { grid-column: 1 / -1; color: #8a7a58; font-size: 11px; }
.pg-sheet .pg-warn { margin: 4px 0 0; color: #b0452a; font-size: 12px; font-weight: 700; }
.pg-sheet h6 { margin: 0; font-size: 13px; color: #8a5a12; }
.pg-sheet h6 small { color: #8a7a58; font-weight: 600; }
.pg-sheet .pg-bag { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; max-height: 190px; overflow-y: auto; padding: 2px; align-content: start; }
.pg-sheet .slot.pg-it { position: relative; width: auto; height: auto; min-height: 76px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; border: 1.5px solid #e3d3a8; background: #fffdf6; font: inherit; color: #3b2a14; cursor: pointer; }
.pg-sheet .slot.pg-it small { font-size: 11px; line-height: 1.15; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pg-sheet .slot.pg-it .pg-ic { width: 40px; height: 40px; } .pg-sheet .slot.pg-it .pg-ic img { width: 40px; height: 40px; }
.pg-sheet .slot.pg-it.sel { border: 2px solid #2f6f73; background: #e9f5f3; }
.pg-sheet .slot.pg-it.r-good { border-bottom: 3px solid #2f8ae0; } .pg-sheet .slot.pg-it.r-rare { border-bottom: 3px solid #9a4ae8; } .pg-sheet .slot.pg-it.r-epic { border-bottom: 3px solid #e8a82a; }
.pg-sheet .pg-empty, .pg-sheet .pg-hint { margin: 0; color: #6b5a38; font-size: 12.5px; }
.pg-sheet .pg-det { display: grid; gap: 6px; padding: 8px 10px; border-radius: 12px; background: #fff; border: 1.5px solid #e6d3a6; }
.pg-sheet .pg-dh { display: flex; gap: 8px; align-items: center; }
.pg-sheet .pg-dic { width: 40px; height: 40px; display: grid; place-items: center; } .pg-sheet .pg-dic img { width: 40px; height: 40px; object-fit: contain; }
.pg-sheet .pg-dh b { display: block; font-size: 14px; } .pg-sheet .pg-dh small { color: #6b5a38; font-size: 12px; }
.pg-sheet .pg-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: #6b5a38; } .pg-sheet .pg-stats b { color: #2f8a3a; }
.pg-sheet .pg-btn { min-height: 44px; border-radius: 12px; border: 1.5px solid #d8c49a; background: linear-gradient(#fffaf0, #f6ebd0); font: inherit; font-weight: 800; color: #4a3520; cursor: pointer; }
.pg-sheet .pg-btn.main { border-color: #2f6f73; background: linear-gradient(#3f8584, #2f6f73); color: #fff; }
.pg-sheet .pg-btn[disabled] { opacity: .5; cursor: not-allowed; }
.pg-sheet .pg-note { margin: 0; flex: none; font-size: 11.5px; color: #8a7a58; }
.pg-sheet .sd-fit { outline: 2px dashed #2f8a3a; outline-offset: 2px; }
/* มือถือแนวนอน (สูง ≤ 430): ชิดบน เตี้ยลง · ช่องเล็กลง · รายการเลื่อนในตัว */
@media (max-height: 430px) {
  dialog.pg-sheet { padding: 8px 10px; gap: 6px; width: min(720px, calc(100vw - 16px)); }
  .pg-sheet .pg-mob { width: 36px; height: 36px; }
  .pg-sheet .pg-body { grid-template-columns: 200px minmax(0, 1fr); gap: 10px; }
  .pg-sheet .eqslot.pg-slot { min-height: 82px; }
  .pg-sheet .pg-ic { width: 40px; height: 40px; } .pg-sheet .pg-ic img { width: 40px; height: 40px; }
  .pg-sheet .pg-bag { max-height: 112px; }
  .pg-sheet .pg-note { display: none; }
}
@media (max-width: 520px) { .pg-sheet .pg-body { grid-template-columns: 1fr; overflow-y: auto; } }

/* ── การ์ดคู่หูอ่านอย่างเดียว (ใบ 203 · companion-view.js) ── */
dialog.pcv-sheet { width: min(560px, calc(100vw - 24px)); }
.pcv-sheet .pcv-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; min-height: 0; overflow-y: auto; }
.pcv-sheet .pcv-col { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pcv-sheet h6 { margin: 2px 0 0; font-size: 12.5px; color: #6b5a38; }
.pcv-sheet .pcv-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pcv-sheet .pcv-lines li { padding: 6px 9px; border-radius: 10px; background: #fff8e8; border: 1.5px solid #e6d3a6; font-weight: 700; font-size: 14px; color: #2f6f73; }
.pcv-sheet .pcv-lines li.lock { color: #8a7a58; font-weight: 400; background: #f7f0e1; border-style: dashed; }
.pcv-sheet .pcv-sk { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 10px; background: #fff8e8; border: 1.5px solid #e6d3a6; }
.pcv-sheet .pcv-sk em { font-style: normal; color: #2f6f73; font-weight: 800; }
.pcv-sheet .pcv-slots { display: grid; gap: 8px; }
.pcv-sheet .pcv-slot { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 6px 9px; border-radius: 12px; background: #fffaf0; border: 1.5px solid #e6d3a6; min-height: 60px; }
.pcv-sheet .pcv-slot.empty { border-style: dashed; background: #f7f0e1; color: #8a7a58; }
.pcv-sheet .pcv-slot .pcv-ic { grid-row: 1 / 4; width: 48px; height: 48px; display: grid; place-items: center; font-size: 28px; }
.pcv-sheet .pcv-slot.empty .pcv-ic { opacity: .45; }
.pcv-sheet .pcv-slot .pcv-ic img { width: 48px; height: 48px; object-fit: contain; }
.pcv-sheet .pcv-slot b { font-size: 12px; color: #6b5a38; }
.pcv-sheet .pcv-slot .pcv-nm { font-weight: 800; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcv-sheet .pcv-slot small { color: #2f6f73; font-size: 12px; }
@media (max-width: 520px) { .pcv-sheet .pcv-body { grid-template-columns: 1fr; } }
.pet-acts .pet-share-btn { min-height: 44px; }
.gv-pet-btn { min-height: 44px; }
.pcv-sheet .pcv-sk .pet-skic { width: 40px; height: 40px; object-fit: contain; flex: none; border-radius: 10px; }
/* หน้าสถานะ: แถวโบนัสคู่หู (companion-hud.js compStatusNote · 16 ต.ค.) — แถวที่ยังล็อกเป็นสีเทา + Lv ที่ปลด */
.tm-status.pet-status .tm-chip.pet-st-lock { opacity: .62; filter: grayscale(1); }
.tm-status.pet-status .tm-chip.pet-st-lock small { font-size: 10.5px; }

/* info-tags-1108: โอกาสสุ่มแถวโบนัส — ปุ่ม % ท้ายแถว + กล่องรายการ (ประกาศจาก data/companions.json · companion-odds.js) */
.pet-odd { min-width: 30px; min-height: 30px; padding: 0 4px; border-radius: 8px; border: 1px solid #9cc3bf; background: #f2faf8; color: #24575a; font: 800 var(--fs-xs, 12px) var(--font, inherit); cursor: pointer; }
.pet-odd.on { background: #2f6f73; border-color: #2f6f73; color: #fff; }
html.touch-ui .pet-odd { min-width: 44px; min-height: 44px; font-size: var(--fs-sm, 14px); }
.pet-odds-pop { margin: 4px 0 6px; padding: 8px 10px; border-radius: 10px; background: #fffaf0; border: 1px solid #e3d3a8; }
.pet-odds-pop > b { display: block; font-size: var(--fs-sm, 14px); color: #5a4a30; margin-bottom: 4px; }
.pet-odds-pop > small { display: block; margin-top: 4px; font-size: var(--fs-xs, 12px); color: #7a6a50; }
.pet-odds { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 10px; }
.pet-odds li { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 2px 6px; border-radius: 6px; font-size: var(--fs-xs, 12px); color: #3d3424; }
.pet-odds li small { color: #7a6a50; font-size: var(--fs-xs, 12px); }
.pet-odds li b { color: #2f6f73; font-variant-numeric: tabular-nums; }
.pet-odds li.me { background: #e8b64a33; box-shadow: inset 0 0 0 1px #e8b64a; }
.pet-odds-box { margin: 6px 0; }
.pet-odds-box > summary { cursor: pointer; font-weight: 700; color: #24575a; font-size: var(--fs-sm, 14px); min-height: 32px; display: flex; align-items: center; }
html.touch-ui .pet-odds-box > summary { min-height: 44px; }
.pet-odds-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.pet-odds-grid h6 { margin: 2px 0 4px; font-size: var(--fs-xs, 12px); color: #5a4a30; }
.pet-odds-grid .pet-odds { grid-template-columns: 1fr; }
.pet-roll-ask .pet-odds { flex: 1 1 100%; order: 1; }   /* info-tags-1108: โอกาสของแถวที่จะสุ่ม ใต้ปุ่ม */
