/* ข้อมูลตัวละคร: another player's character card (2026-10-18, js/pinfo.js). LORDNINE / MIR4's player info in the game's
   obsidian + gold, laid out at 1040 x 660 and scaled to the window (.pi-win); a phone gets one column (.pi-narrow).
   Over the ranking screen (900) and the books, under the item info card (#itempop 970). No soft halos round text. */
#pinfo { position: fixed; inset: 0; z-index: 962; pointer-events: auto; user-select: none; font-family: 'Mali', sans-serif; color: #f2ead6; }
#pinfo[hidden], #pinfo [hidden] { display: none !important; }
#pinfo button { font-family: 'Mali', sans-serif; color: inherit; }
#pinfo .pi-back { position: absolute; inset: 0; background: rgba(5, 4, 8, 0.62); animation: piFade 0.18s ease-out both; }
@keyframes piFade { from { opacity: 0; } to { opacity: 1; } }
#pinfo .pi-win { position: absolute; left: 50%; top: 50%; transform-origin: 50% 50%; display: flex; flex-direction: column; overflow: hidden; border-radius: 10px;
  background: radial-gradient(ellipse 80% 70% at 40% 40%, #1f1d24 0%, #15141a 60%, #0d0c10 100%);
  box-shadow: 0 0 0 1px rgba(217, 164, 67, 0.55), 0 0 0 4px #0b0a0e, 0 0 0 5px rgba(217, 164, 67, 0.22), 0 24px 60px rgba(0, 0, 0, 0.7); }

/* ---- the head: title, where it comes from, ✕ ---- */
#pinfo .pi-head { position: relative; flex: none; height: 48px; display: flex; align-items: center; gap: 14px; padding: 0 12px 0 22px;
  background: linear-gradient(#0b0a0e, #17151c); border-bottom: 1px solid rgba(217, 164, 67, 0.35); }
#pinfo .pi-head > b { font: 700 21px/1 'Mali', sans-serif; color: #e6d3a3; letter-spacing: 0.5px; }
#pinfo .pi-src { font: 500 12.5px 'Mali', sans-serif; color: #9b927f; }
#pinfo .pi-x { margin-left: auto; width: 36px; height: 36px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
#pinfo .pi-x i { width: 30px; height: 30px; background: var(--uib-btn_close, url(../assets/ui_book/btn_close.png)) center / contain no-repeat; transition: transform 0.12s, filter 0.12s; }
#pinfo .pi-x:hover i, #pinfo .pi-x:focus-visible i { transform: scale(1.1); filter: brightness(1.2); }
#pinfo .pi-x.small { position: absolute; right: 8px; top: 8px; z-index: 2; width: 30px; height: 30px; }
#pinfo .pi-x.small i { width: 24px; height: 24px; }

#pinfo .pi-body { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 470px 1fr; gap: 18px; padding: 16px 18px 16px 16px; }

/* ---- left: the name plate, the stage between the ten pieces, the pet and the mount ---- */
#pinfo .pi-left { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
#pinfo .pi-plate { position: relative; flex: none; padding: 10px 14px 10px; border-radius: 8px; background: linear-gradient(#1c1a21, #131217); box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.28); }
#pinfo .pi-ttl { display: inline-block; margin-bottom: 2px; font: 700 13px 'Mali', sans-serif; color: var(--tc, #e6d3a3); }
#pinfo .pi-plate h3 { margin: 0; display: flex; align-items: center; gap: 8px; font: 700 24px/1.2 'Mali', sans-serif; color: #fff4d6; word-break: break-all; }
#pinfo .pi-plate h3 small { font: 500 13px 'Mali', sans-serif; color: #b9ab8c; }
#pinfo .pi-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #5fdc7a; box-shadow: 0 0 0 2px #0f2a16; }
#pinfo .pi-cls { margin: 4px 0 0; display: flex; align-items: center; gap: 6px; font: 600 15px 'Mali', sans-serif; color: #e6d3a3; }
#pinfo .pi-cls img { width: 26px; height: 26px; object-fit: contain; }
#pinfo .pi-cls b { margin-left: 4px; font: 700 15px Fredoka, Mali, sans-serif; color: #f2c66a; }
#pinfo .pi-guild { position: absolute; right: 14px; bottom: 12px; margin: 0; font: 500 13px 'Mali', sans-serif; color: #9b927f; }
#pinfo .pi-guild b { color: #9fe8b4; font-weight: 700; }

#pinfo .pi-stage { position: relative; flex: none; height: 384px; border-radius: 8px; overflow: hidden; display: grid; grid-template-columns: 72px 1fr 72px; gap: 8px; padding: 10px;
  background: url(../assets/ui_book/stage_bg.png) center bottom / cover no-repeat, #121116; box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.3); }
#pinfo .pi-hero { width: 100%; height: 100%; min-width: 0; }
#pinfo .pi-slots { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; }
#pinfo .pi-slot { position: relative; width: 66px; height: 66px; padding: 0; border: 0; border-radius: 9%; cursor: pointer; display: grid; place-items: center;
  background: url(../assets/ui_slot_mir4/slot_g0.png) center / 100% 100% no-repeat; transition: filter 0.12s; }
#pinfo .pi-slot.g1 { background-image: url(../assets/ui_slot_mir4/slot_g1.png); }
#pinfo .pi-slot.g2 { background-image: url(../assets/ui_slot_mir4/slot_g2.png); }
#pinfo .pi-slot.g3 { background-image: url(../assets/ui_slot_mir4/slot_g3.png); }
#pinfo .pi-slot.g4 { background-image: url(../assets/ui_slot_mir4/slot_g4.png); }
#pinfo .pi-slot.g5 { background-image: url(../assets/ui_slot_mir4/slot_g5.png); box-shadow: 0 0 10px 2px rgba(255, 90, 60, 0.55); }
#pinfo .pi-slot.empty { cursor: default; background-image: url(../assets/ui_slot_mir4/slot_empty.png); opacity: 0.8; }
#pinfo button.pi-slot:hover { filter: brightness(1.15); }
#pinfo .pi-slot.sel { box-shadow: 0 0 0 2px #e8f6ff, 0 0 0 4px rgba(120, 190, 255, 0.55), 0 0 12px 3px rgba(140, 200, 255, 0.75); }
#pinfo .pi-slot img { width: 86%; height: 86%; object-fit: contain; pointer-events: none; }
#pinfo .pi-slot .pl { position: absolute; right: 4px; top: 2px; font: 700 13px Fredoka, sans-serif; color: #fff;
  text-shadow: 1px 0 0 #1a0c0c, -1px 0 0 #1a0c0c, 0 1px 0 #1a0c0c, 0 -1px 0 #1a0c0c; }
#pinfo .pi-slot .sn { position: absolute; left: 5px; bottom: 3px; font: 700 11px Fredoka, sans-serif; font-style: normal; color: #fff1cc;
  text-shadow: 1px 0 0 #1a0c0c, -1px 0 0 #1a0c0c, 0 1px 0 #1a0c0c, 0 -1px 0 #1a0c0c; }
#pinfo .pi-slot .stp { position: absolute; left: 5px; top: 3px; font: 700 11px Fredoka, sans-serif; font-style: normal; color: #f2c66a;
  text-shadow: 1px 0 0 #1a0c0c, -1px 0 0 #1a0c0c, 0 1px 0 #1a0c0c, 0 -1px 0 #1a0c0c; }
#pinfo .pi-slot .pvp { position: absolute; right: 4px; bottom: 2px; font-size: 11px; font-style: normal; }
#pinfo .pi-slot small { position: absolute; left: 0; right: 0; bottom: -1px; transform: translateY(100%); display: none; }
#pinfo .pi-slot.empty small { display: block; position: static; transform: none; font: 500 10.5px 'Mali', sans-serif; color: #6f6858; text-align: center; }
#pinfo .pi-lock { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(8, 7, 11, 0.55); }
#pinfo .pi-lock i { font-size: 54px; font-style: normal; filter: grayscale(0.3); }
#pinfo .pi-lock b { font: 700 17px 'Mali', sans-serif; color: #e6d3a3; }

#pinfo .pi-ride { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
#pinfo .pi-chip { min-width: 0; }
#pinfo .pi-chip { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 10px; border-radius: 8px; background: #121116; box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.22); }
#pinfo .pi-chip img { flex: none; width: 42px; height: 42px; object-fit: contain; }
#pinfo .pi-chip > span:last-child { display: flex; flex-direction: column; min-width: 0; }
#pinfo .pi-chip b { font: 700 14px 'Mali', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pinfo .pi-chip small { font: 500 12px 'Mali', sans-serif; color: #9b927f; }
#pinfo .pi-chipk { flex: none; writing-mode: horizontal-tb; font: 600 11px 'Mali', sans-serif; color: #b9ab8c; padding: 2px 6px; border-radius: 4px; background: rgba(0, 0, 0, 0.45); }
#pinfo .pi-chip.none { opacity: 0.6; }

/* ---- right: CP, the tabs, the page, the actions ---- */
#pinfo .pi-right { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
#pinfo .pi-cp { flex: none; display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; }
#pinfo .pi-cpmain, #pinfo .pi-cpsub > span { display: flex; flex-direction: column; justify-content: center; padding: 8px 14px; border-radius: 8px; background: linear-gradient(#221d14, #15120d); box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.45); }
#pinfo .pi-cpmain small, #pinfo .pi-cpsub small { font: 600 12px 'Mali', sans-serif; color: #b9ab8c; }
#pinfo .pi-cpmain b { font: 700 32px/1.1 Fredoka, Mali, sans-serif; color: #f6d47a; font-variant-numeric: tabular-nums; }
#pinfo .pi-cpsub { display: grid; grid-template-rows: 1fr 1fr; gap: 6px; }
#pinfo .pi-cpsub > span { flex-direction: row; align-items: center; justify-content: space-between; padding: 4px 12px; background: #121116; box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.25); }
#pinfo .pi-cpsub b { font: 700 17px Fredoka, Mali, sans-serif; color: #f2ead6; font-variant-numeric: tabular-nums; }

#pinfo .pi-tabs { flex: none; display: flex; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
#pinfo .pi-tabs button { flex: 1; height: 36px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: none; color: #9b927f; font: 600 14.5px 'Mali', sans-serif; cursor: pointer; }
#pinfo .pi-tabs button.on { color: #f2c66a; border-bottom-color: #d9a443; background: linear-gradient(rgba(217, 164, 67, 0), rgba(217, 164, 67, 0.13)); }
#pinfo .pi-tabs button:not(.on):hover { color: #e6d3a3; }
#pinfo .pi-pane { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px; user-select: text; scrollbar-width: thin; scrollbar-color: #6b5531 #121116; }
#pinfo .pi-cols { columns: 2; column-gap: 14px; }
#pinfo .pi-group { break-inside: avoid; margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.25); box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.16); }
#pinfo .pi-group h4 { margin: 0 0 4px; font: 700 13.5px 'Mali', sans-serif; color: #f2c66a; }
#pinfo .pi-group h4 small { font-weight: 500; color: #9b927f; }
#pinfo .pi-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; font: 500 13px 'Mali', sans-serif; color: #d9cfb6; border-bottom: 1px dashed rgba(255, 255, 255, 0.06); }
#pinfo .pi-row:last-child { border-bottom: 0; }
#pinfo .pi-row > span { display: flex; align-items: center; gap: 6px; min-width: 0; }
#pinfo .pi-row b { font: 600 13.5px Fredoka, Mali, sans-serif; color: #fff4d6; white-space: nowrap; font-variant-numeric: tabular-nums; }
#pinfo .pi-row.dim { opacity: 0.45; }
#pinfo .pi-sk { min-width: 34px; font: 700 12px Fredoka, sans-serif; font-style: normal; color: #f2c66a; }
#pinfo .pi-main { font: 600 10.5px 'Mali', sans-serif; font-style: normal; padding: 1px 6px; border-radius: 8px; background: #6b5531; color: #fff1cc; }
#pinfo .pi-ci { width: 20px; height: 20px; object-fit: contain; }
#pinfo .pi-note { margin: 6px 2px; font: 500 12.5px/1.5 'Mali', sans-serif; color: #9b927f; }
#pinfo .pi-hidden { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 30px; padding: 26px 20px; border-radius: 10px; text-align: center; background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.25); }
#pinfo .pi-hidden i { font-size: 40px; font-style: normal; }
#pinfo .pi-hidden b { font: 700 17px 'Mali', sans-serif; color: #e6d3a3; }
#pinfo .pi-hidden p { margin: 0; font: 500 13px/1.6 'Mali', sans-serif; color: #b9ab8c; }
#pinfo .pi-hidden.thin { margin-top: 10px; }

/* your own card: the switch */
#pinfo .pi-self { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; padding: 10px 12px; border-radius: 8px; background: #121116; box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.35); }
#pinfo .pi-self.on { box-shadow: inset 0 0 0 1px rgba(242, 198, 106, 0.8); background: linear-gradient(#211c12, #15120d); }
#pinfo .pi-self > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
#pinfo .pi-self b { font: 700 14.5px 'Mali', sans-serif; color: #f2c66a; }
#pinfo .pi-self small { font: 500 12px/1.45 'Mali', sans-serif; color: #b9ab8c; }
#pinfo .pi-switch { flex: none; position: relative; width: 52px; height: 28px; padding: 0; border: 0; border-radius: 14px; cursor: pointer; background: #3a3540; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); transition: background 0.15s; }
#pinfo .pi-switch i { position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #d9cfb6; transition: transform 0.15s; }
#pinfo .pi-switch.on { background: #b8892f; }
#pinfo .pi-switch.on i { transform: translateX(24px); background: #fff4d6; }

#pinfo .pi-acts { flex: none; display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; }
#pinfo .pi-acts:empty { display: none; }
#pinfo .pi-btn { height: 34px; padding: 0 16px; border: 1px solid #7a5a2a; border-radius: 4px; cursor: pointer; background: linear-gradient(#3a2f20, #251d14); color: #f2dfae; font: 600 13.5px 'Mali', sans-serif; }
#pinfo .pi-btn:hover:not([disabled]), #pinfo .pi-btn:focus-visible { border-color: #d9a443; color: #fff1cc; }
#pinfo .pi-btn[disabled] { opacity: 0.45; cursor: default; }

/* a piece's own card (over the right side) */
#pinfo .pi-item { position: absolute; z-index: 3; top: 12px; right: 14px; bottom: 12px; width: calc(100% - 470px - 36px); overflow-y: auto; padding: 14px 14px 14px; border-radius: 10px;
  background: #16141b; box-shadow: 0 0 0 1px rgba(217, 164, 67, 0.6), 0 12px 30px rgba(0, 0, 0, 0.6); user-select: text; scrollbar-width: thin; scrollbar-color: #6b5531 #121116; }
#pinfo .pi-itemin { padding-right: 26px; }
#pinfo .pi-item .eco-ihead { align-items: flex-start; }
#pinfo .pi-item .eco-iframe { position: relative; flex: none; width: 76px; height: 76px; border-radius: 9%; display: grid; place-items: center; background: url(../assets/ui_slot_mir4/slot_g0.png) center / 100% 100% no-repeat; }
#pinfo .pi-item .eco-ihead.g1 .eco-iframe { background-image: url(../assets/ui_slot_mir4/slot_g1.png); }
#pinfo .pi-item .eco-ihead.g2 .eco-iframe { background-image: url(../assets/ui_slot_mir4/slot_g2.png); }
#pinfo .pi-item .eco-ihead.g3 .eco-iframe { background-image: url(../assets/ui_slot_mir4/slot_g3.png); }
#pinfo .pi-item .eco-ihead.g4 .eco-iframe { background-image: url(../assets/ui_slot_mir4/slot_g4.png); }
#pinfo .pi-item .eco-ihead.g5 .eco-iframe { background-image: url(../assets/ui_slot_mir4/slot_g5.png); }
#pinfo .pi-item .eco-iframe img { width: 86%; height: 86%; padding: 0; background: none; border-radius: 0; object-fit: contain; }
#pinfo .pi-item .eco-iframe .plus { position: absolute; right: 4px; top: 2px; font: 700 14px Fredoka, sans-serif; color: #fff; text-shadow: 1px 0 0 #1a0c0c, -1px 0 0 #1a0c0c, 0 1px 0 #1a0c0c, 0 -1px 0 #1a0c0c; }
#pinfo .pi-item .eco-iframe .cx-rays, #pinfo .pi-item .eco-iframe .cx-gem { display: none; }
#pinfo .pi-item .eco-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
#pinfo .pi-item .eco-chips i { font: 500 12px/1 'Mali', sans-serif; font-style: normal; padding: 4px 8px; border-radius: 10px; background: rgba(0, 0, 0, 0.45); color: #e9e2cf; box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.3); }
#pinfo .pi-item .eco-stats { list-style: none; margin: 10px 0 0; padding: 0; }
#pinfo .pi-item .eco-stats li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font: 500 13.5px 'Mali', sans-serif; }
#pinfo .pi-item .eco-stats li b { margin-left: auto; font: 700 14px Fredoka, Mali, sans-serif; color: #fff4d6; }
#pinfo .pi-item .eco-stats li em { font: 600 12px Fredoka, sans-serif; font-style: normal; }
#pinfo .pi-item .eco-stats li em.up { color: #7fe07a; }
#pinfo .pi-item .eco-stats li em.down { color: #ff7a6a; }
#pinfo .pi-item .eco-note { margin: 8px 0; font: 500 12px/1.45 'Mali', sans-serif; color: #b9ab8c; }
#pinfo .pi-item .eco-set span.on { color: #7fe07a; }
#pinfo .pi-item .eco-set span { font: 500 12.5px/1.45 'Mali', sans-serif; color: #9b927f; }
#pinfo .pi-item .eco-trait { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.22); box-shadow: inset 0 0 0 1px rgba(242, 193, 78, 0.22); font-size: 12.5px; }

#pinfo .pi-busy { position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 8px; background: #0d0c10; box-shadow: 0 0 0 1px rgba(217, 164, 67, 0.5); font: 600 14px 'Mali', sans-serif; }
#pinfo .pi-busy i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #6b5531; border-top-color: #f2c66a; animation: piSpin 0.8s linear infinite; }
@keyframes piSpin { to { transform: rotate(360deg); } }
#pinfo .pi-say { position: absolute; left: 50%; bottom: 18px; z-index: 6; transform: translateX(-50%); max-width: calc(100% - 40px); padding: 9px 18px; border-radius: 6px;
  background: #0d0c10; box-shadow: 0 0 0 1px rgba(217, 164, 67, 0.6); font: 600 13.5px 'Mali', sans-serif; color: #fff1cc; text-align: center; pointer-events: none; }
#pinfo .pi-say.in { animation: piFade 0.2s ease-out both; }

/* ---- a phone: one column, scrolling ---- */
#pinfo.pi-narrow .pi-body { display: flex; flex-direction: column; overflow-y: auto; gap: 12px; padding: 12px; }
#pinfo.pi-narrow .pi-left, #pinfo.pi-narrow .pi-right { flex: none; }
#pinfo.pi-narrow .pi-stage { height: 384px; }
#pinfo.pi-narrow .pi-pane { flex: none; overflow: visible; }
#pinfo.pi-narrow .pi-cols { columns: 1; }
#pinfo.pi-narrow .pi-item { position: fixed; left: 8px; right: 8px; top: 56px; bottom: 8px; width: auto; }
#pinfo.pi-narrow .pi-guild { position: static; margin-top: 4px; }

/* the small menu over a name in the chat */
.pi-menu { position: fixed; z-index: 963; display: flex; flex-direction: column; min-width: 150px; padding: 6px; border-radius: 8px; background: #16141b; box-shadow: 0 0 0 1px rgba(217, 164, 67, 0.6), 0 10px 24px rgba(0, 0, 0, 0.6); font-family: 'Mali', sans-serif; }
.pi-menu[hidden] { display: none; }
.pi-menu b { padding: 2px 8px 6px; font: 700 13.5px 'Mali', sans-serif; color: #f2c66a; border-bottom: 1px solid rgba(255, 255, 255, 0.08); margin-bottom: 4px; }
.pi-menu button { padding: 7px 10px; border: 0; border-radius: 5px; background: none; color: #f2ead6; font: 600 13.5px 'Mali', sans-serif; text-align: left; cursor: pointer; }
.pi-menu button:hover, .pi-menu button:focus-visible { background: rgba(217, 164, 67, 0.18); color: #fff1cc; }
/* the settings button (js/ui.js #p-privacy) while on */
#p-privacy.on { box-shadow: inset 0 0 0 1px #f2c66a; }
/* a player's name in the party / guild / nearby lists (js/content.js pvName): opens their card */
.ct-pv { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline dotted rgba(242, 198, 106, 0.6); text-underline-offset: 3px; }
.ct-pv:hover, .ct-pv:focus-visible { color: #f2c66a; }
/* a name in the chat can be tapped (a small menu) */
#chat .chat-line .who { cursor: pointer; }
#pinfo .pi-wait { position: absolute; left: 50%; top: 48%; z-index: 1; transform: translate(-50%, -50%); padding: 6px 14px; border-radius: 6px; background: rgba(8, 7, 11, 0.6); font: 600 13px 'Mali', sans-serif; color: #e6d3a3; pointer-events: none; }
