/* ปาร์ตี้ v2 (3 ต.ค. · party-ui.js) — ตามภาพคอนเซปต์ผู้ใช้: แผงครีม หัว teal ทองเน้น ภาพหน้าสมาชิกเป็นพระเอก
   แถบบนจอ #party-hud.pv2 · หน้าต่าง .pv-win · เมนู .pv-menu
   ⚠️ ตำแหน่งของแถบบนจอสัมผัสเป็นของ ui-root.js (โซน tr) — ไฟล์นี้ไม่ตั้ง position/top/left ให้แถบบนจอสัมผัส */

/* ── แถบบนจอ ── */
html body #party-hud.pv2 { width: 228px; padding: 0; font-size: 12px; color: #4b2d17; border-image: none; border: 2px solid #e2cc98; border-radius: 14px;
  background: linear-gradient(#fffaf0, #fbf1da); box-shadow: 0 6px 16px rgba(75, 45, 23, .22), inset 0 0 0 2px #fffdf6; overflow: hidden; }
html body #party-hud.pv2 .pv-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: linear-gradient(#3b8a88, #2f6f73); color: #fff8e2; cursor: pointer; user-select: none; }
html body #party-hud.pv2 .pv-head .pt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13px/1.2 'Mitr', 'Anuphan', sans-serif; color: #fff8e2; }
html body #party-hud.pv2 .pt-count { float: none; font: 600 12px 'Mitr', sans-serif; opacity: 1; color: #ffe7a6; }
html body #party-hud.pv2 .pv-fold { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 6px; background: #e8b64a; color: #4b2d17; font-size: 11px; transition: transform .15s; }
html body #party-hud.pv2.folded .pv-fold { transform: rotate(-90deg); }
html body #party-hud.pv2 .pv-ico { font-size: 14px; }
html body #party-hud.pv2 .pv-chip { display: none; }
html body #party-hud.pv2 .pv-list { padding: 4px 5px 2px; }
html body #party-hud.pv2.folded .pv-list, html body #party-hud.pv2.folded .pv-detail { display: none; }
html body #party-hud.pv2 .pv-row { position: relative; display: flex; align-items: center; gap: 6px; margin: 3px 0; padding: 4px 4px 4px 3px; border-radius: 10px; background: #fffdf6; border: 1px solid #f0e2bf; cursor: pointer; }
html body #party-hud.pv2 .pv-row:hover { background: #fff6dc; }
html body #party-hud.pv2 .pv-row.on { background: #e3f2ee; box-shadow: inset 0 0 0 1.5px #2f7776; }
html body #party-hud.pv2 .pv-row.off { opacity: .55; cursor: default; }
html body #party-hud.pv2 .pv-row.dead .pv-face img { filter: grayscale(1); }
html body #party-hud.pv2 .pv-main { flex: 1; min-width: 0; }
html body #party-hud.pv2 .pm-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
html body #party-hud.pv2 .pv-name { font: 600 12.5px/1.2 'Mitr', 'Anuphan', sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body #party-hud.pv2 .pv-lv { font-size: 10.5px; color: #7a6048; white-space: nowrap; }
html body #party-hud.pv2 .rbar { height: 7px; margin-top: 2px; border-radius: 4px; background: #e9dcc0; overflow: hidden; --bh: 7px; border: 0; }
html body #party-hud.pv2 .rbar.sp { height: 4px; --bh: 4px; }
html body #party-hud.pv2 .rbar i { display: block; height: 100%; border-radius: inherit; }
html body #party-hud.pv2 .rbar.hp i { background: linear-gradient(#ff8a7a, #d9443a); }
html body #party-hud.pv2 .rbar.sp i { background: linear-gradient(#7cc2ff, #2f7fd0); }
html body #party-hud.pv2 .pv-job { width: 20px; height: 20px; object-fit: contain; flex: none; }
html body #party-hud.pv2 .pv-more { flex: none; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid #e2cc98; background: #fff8e6; color: #7a6048; font-size: 13px; line-height: 1; cursor: pointer; }
html body #party-hud.pv2 .pv-more:hover { background: #e8b64a; color: #4b2d17; }
html body #party-hud.pv2 .pv-crown { position: absolute; left: -1px; top: -6px; font-size: 13px; font-style: normal; filter: drop-shadow(0 1px 0 #fff); pointer-events: none; }
html body #party-hud.pv2 .pv-detail { display: flex; justify-content: center; align-items: center; gap: 6px; width: calc(100% - 10px); margin: 2px 5px 6px; padding: 5px; border-radius: 9px; border: 1px solid #e2cc98;
  background: #fff3d2; color: #4b2d17; font: 600 12px 'Mitr', 'Anuphan', sans-serif; cursor: pointer; }
html body #party-hud.pv2 .pv-detail:hover { background: #ffe9ad; }

/* ภาพหน้า: วงกลมขอบสีตามบทบาท (แทงก์ ฟ้า · ฮีล เขียว · ดาเมจ ส้ม · เศรษฐกิจ ทอง) */
.pv-face { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 60%, #fff4d6, #efddb2);
  box-shadow: 0 0 0 2px var(--rc, #e2cc98), 0 2px 4px rgba(75, 45, 23, .25); }
.pv-face img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.pv-face img.real { object-fit: cover; padding: 0; transform: scale(1.12); }
.pv-face.off img { filter: grayscale(.8); }
.pv-face.xs { width: 22px; height: 22px; margin-left: -7px; box-shadow: 0 0 0 1.5px #fffaf0; }
.pv-face.xs:first-child { margin-left: 0; }
.pv-face.lg { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 0 0 3px var(--rc, #e2cc98), 0 4px 10px rgba(75, 45, 23, .25); }
.role-tank { --rc: #4f8fd6; } .role-heal { --rc: #4faa5f; } .role-dps { --rc: #e58a3a; } .role-util { --rc: #d4a62c; } .role-new { --rc: #b9a27a; }

/* จอสัมผัส (แนวนอน · จอเตี้ย ~390px): แถบเต็มไม่มีที่ยืน (ui-mobile.css เคยซ่อนทิ้ง) → เหลือ "ชิป" เล็กเสมอ
   ภาพหน้าซ้อน + จำนวน · แตะ = เปิดหน้าต่างปาร์ตี้ (ภาพคอนเซปต์ข้อ Mobile collapsed state) */
html.touch-ui body #party-hud.pv2 { display: block !important; width: auto; border-radius: 999px; }
html.touch-ui body #party-hud.pv2 :is(.pv-head, .pv-list, .pv-detail) { display: none; }
html.touch-ui body #party-hud.pv2 .pv-chip { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 12px 4px 7px; border: 0; background: none; color: #4b2d17; cursor: pointer; font: 600 13px 'Mitr', sans-serif; }
html.touch-ui body #party-hud.pv2 .pv-chip .pt-count { color: #2f6f73; }
html.touch-ui body #party-hud.pv2 .pv-stack { display: flex; }
html.touch-ui body #party-hud.pv2 .pv-face.xs { width: 28px; height: 28px; margin-left: -9px; }
html.touch-ui body #party-hud.pv2 .pv-face.xs:first-child { margin-left: 0; }

/* ── หน้าต่าง ── */
.pv-win { display: flex; flex-direction: column; gap: 10px; color: #4b2d17; }
.pv-title { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(#fffaf0, #fbf1da); border: 1.5px solid #ecdcb6; }
.pv-title .pv-ico { font-size: 22px; }
.pv-title > div { flex: 1; min-width: 0; } .pv-title b { display: block; font: 600 17px/1.3 'Mitr', 'Anuphan', sans-serif; } .pv-title small { color: #7a6048; font-size: 12.5px; }
.pv-size { font: 600 15px 'Mitr', sans-serif; color: #2f6f73; white-space: nowrap; } .pv-size small { color: #a08a6a; font-size: 11px; }
.pv-cards { display: grid; gap: 8px; max-height: min(52vh, 460px); overflow: auto; padding: 2px; }
.pv-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: #fffdf6; border: 1.5px solid #ecdcb6; box-shadow: 0 2px 6px rgba(75, 45, 23, .08); }
.pv-card.off { opacity: .62; } .pv-card.dead .pv-face img { filter: grayscale(1); }
.pv-info { flex: 1; min-width: 0; }
.pv-nameline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .pv-nameline b { font: 600 15px/1.3 'Mitr', 'Anuphan', sans-serif; }
.pv-badge { padding: 1px 8px; border-radius: 999px; background: linear-gradient(#f2c460, #e8b64a); color: #4b2d17; font: 600 11px 'Mitr', sans-serif; }
.pv-you { padding: 1px 7px; border-radius: 999px; background: #e3f2ee; color: #1f5051; font-size: 11px; }
.pv-sub { font-size: 12.5px; color: #7a6048; margin: 1px 0 5px; }
.pv-role { margin-left: 4px; padding: 0 7px; border-radius: 6px; font-size: 11px; color: #fff; background: var(--rc); }
.pv-bar { position: relative; height: 15px; margin: 3px 0; border-radius: 8px; background: #e9dcc0; overflow: hidden; font: 600 10.5px/15px 'Mitr', sans-serif; }
.pv-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; transition: width .3s; }
.pv-bar.hp i { background: linear-gradient(#ff8a7a, #d9443a); } .pv-bar.sp i { background: linear-gradient(#7cc2ff, #2f7fd0); }
.pv-bar span { position: absolute; left: 7px; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.pv-bar em { position: absolute; left: 0; right: 0; text-align: center; font-style: normal; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .4); }
.pv-offline { font-size: 12.5px; color: #7a6048; }
.pv-card .pv-job { position: absolute; right: 10px; top: 8px; width: 26px; height: 26px; object-fit: contain; }
.pv-acts { display: flex; gap: 6px; align-self: flex-end; }
.pv-acts button { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1.5px solid #e2cc98; background: #fff3d2; font-size: 15px; cursor: pointer; }
.pv-acts button:hover { background: #ffe39a; }
.pv-empty { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; border: 2px dashed #e2cc98; background: #fffaf0b0; color: #a08a6a; cursor: pointer; text-align: left; font: inherit; }
.pv-empty span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #f3e7cc; font-size: 18px; color: #b0945e; }
.pv-empty b { font: 600 13px 'Mitr', sans-serif; color: #7a6048; } .pv-empty small { font-size: 12px; margin-left: 4px; }
.pv-empty:hover { border-color: #2f7776; color: #2f7776; }
.pv-bottom { display: grid; grid-template-columns: 1.1fr 1fr; gap: 10px; align-items: stretch; }
.pv-rules { padding: 10px 12px; border-radius: 14px; background: linear-gradient(#fffaf0, #fbf1da); border: 1.5px solid #ecdcb6; font-size: 12.5px; }
.pv-rules > b { display: block; margin-bottom: 4px; font: 600 13px 'Mitr', sans-serif; }
.pv-rules > div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dotted #e2cc98; } .pv-rules em { font-style: normal; color: #2f6f73; text-align: right; }
.pv-open { display: flex; justify-content: space-between; align-items: center; padding-top: 6px; cursor: pointer; }
.pv-open input { position: absolute; opacity: 0; pointer-events: none; }
.pv-open i { width: 38px; height: 22px; border-radius: 999px; background: #d8c8a4; position: relative; transition: background .15s; }
.pv-open i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.pv-open input:checked + i { background: #2f7776; } .pv-open input:checked + i::after { left: 19px; }
.pv-open.ro { cursor: default; opacity: .75; }
.pv-invite { display: flex; flex-direction: column; gap: 7px; justify-content: flex-end; }
.pv-invite input { min-height: 38px; padding: 6px 12px; border-radius: 10px; border: 1.5px solid #e2cc98; background: #fffdf6; font: inherit; }
.pv-invite button { min-height: 40px; border-radius: 12px; font: 600 14px 'Mitr', 'Anuphan', sans-serif; }
.pv-invite .main { background: linear-gradient(#3b8a88, #2f6f73); color: #fff; border: 0; box-shadow: 0 3px 0 #1f5051; }
.pv-invite .rbtn { background: linear-gradient(#ee7a5f, #d4553c); color: #fff; border: 0; box-shadow: 0 3px 0 #a33c28; }
.pv-menu .danger { color: #b33b3b; }

/* จอสัมผัส (แนวนอน · Screen Shell เต็มจอ): การ์ดเลื่อนฝั่งซ้าย · กติกา/เชิญ/ออก ฝั่งขวาติดจอ (จอเตี้ย ซ้อนบน-ล่างไม่พอ) · ปุ่มใหญ่ */
html.touch-ui .pv-win { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr); grid-template-rows: auto 1fr; gap: 10px; height: 100%; }
html.touch-ui .pv-title { grid-column: 1 / -1; }
html.touch-ui .pv-cards { grid-template-columns: 1fr; max-height: none; min-height: 0; overflow: auto; align-content: start; }
html.touch-ui .pv-bottom { grid-template-columns: 1fr; align-content: start; overflow: auto; }
html.touch-ui .pv-acts button { width: 44px; height: 44px; }
html.touch-ui .pv-invite input { min-height: 46px; } html.touch-ui .pv-invite button { min-height: 48px; }
@media (max-width: 560px) { .pv-bottom { grid-template-columns: 1fr; } }
/* จอคอม: ให้ส่วนล่าง (กติกา · เชิญ · ออก) อยู่ในจอเสมอ — การ์ดเลื่อนในกล่องของมันเอง */
html:not(.touch-ui) .pv-cards { max-height: max(160px, min(320px, calc(100vh - 570px))); }
html:not(.touch-ui) .pv-card { padding: 8px 10px; } html:not(.touch-ui) .pv-face.lg { width: 64px; height: 64px; border-radius: 16px; }
html:not(.touch-ui) .pv-empty { padding: 6px 12px; } html:not(.touch-ui) .pv-empty span { width: 28px; height: 28px; }
html.touch-ui .pv-face.lg { width: 60px; height: 60px; border-radius: 16px; }
html.touch-ui .pv-badge, html.touch-ui .pv-role { white-space: nowrap; }
html.touch-ui .pv-rules > div { flex-wrap: wrap; } html.touch-ui .pv-rules em { flex: 1 1 auto; }
html.touch-ui .pv-invite { order: -1; }   /* จอเตี้ย: ปุ่มเชิญ/ออก ขึ้นก่อนกติกา ไม่ต้องเลื่อนหา */
