/* social.css — chat dunia, kartu pemain, daftar teman. Arah "Observatory Brass": rel kuningan, log perkamen. */
.wz-social { position: absolute; inset: 0; pointer-events: none; font-family: var(--font-ui); color: var(--parch-ink); }
.wz-hud.dialog-open .wz-social, .wz-hud.modal-open .wz-social, body.cinematic .wz-social { display: none; }
.wz-social button { font: inherit; color: inherit; cursor: pointer; }
.wz-social svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- panel chat (kanan kompas) ---------- */
.wz-chat {
  position: absolute; left: calc(var(--sl) + var(--compass, 200px) + 24px); bottom: calc(var(--sb) + 8px); width: var(--chat-w, 318px); pointer-events: auto;
  display: flex; flex-direction: column; filter: drop-shadow(0 10px 16px rgba(20, 12, 0, .22));
}
.wz-chat-head { position: relative; z-index: 2; display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px; border-radius: 5px 5px 2px 2px; }
.wz-chat-tabs { display: flex; gap: 4px; }
.wz-chat-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 21px; padding: 0 10px; border: 0; border-radius: 3px; background: none;
  font: 800 12px/1 var(--font-ui); color: var(--brass-ink); text-shadow: 0 1px 0 rgba(255, 244, 205, .7); }
.wz-chat-tabs button:hover { background: rgba(255, 244, 205, .3); }
.wz-chat-tabs button[aria-selected="true"] { background: var(--enamel); color: #fff; text-shadow: none; box-shadow: inset 0 1px 0 rgba(210, 195, 255, .45), 0 0 0 1px #4a3210, inset 0 -1px 3px rgba(10, 5, 40, .5); }
.wz-tab-n { font: 500 10px/1 var(--font-mono); padding: 2px 4px; border-radius: 3px; background: rgba(74, 50, 16, .2); }
.wz-chat-tabs button[aria-selected="true"] .wz-tab-n { background: rgba(255, 255, 255, .18); }
.wz-chat-head .wz-chat-fr { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 6px; border: 0; border-radius: 3px; background: none; font: 500 10.5px/1 var(--font-mono); color: var(--brass-ink); }
.wz-chat-fr svg { width: 16px; height: 16px; stroke-width: 1.7; }
.wz-chat-fr:hover, .wz-chat-x:hover { background: rgba(255, 244, 205, .35); }
.wz-chat-x { width: 22px; height: 22px; border: 0; border-radius: 3px; background: none; display: grid; place-items: center; color: var(--brass-ink); transform: rotate(0deg); transition: transform .2s; }
.wz-chat-x svg { width: 17px; height: 17px; stroke-width: 1.6; }
.wz-chat-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font: 500 10.5px/18px var(--font-mono); text-align: center; color: #fff;
  background: radial-gradient(circle at 35% 30%, #f08b70, #d9573b 50%, #9c3520); box-shadow: 0 0 0 1.5px #f2d48a, 0 0 0 2.5px #5a3d10; }
.wz-chat-head .wz-chat-badge { margin-left: 4px; }
.wz-chat-body { position: relative; margin: -1px 6px 0; padding: 8px 12px 10px; box-shadow: 0 0 0 1px rgba(110, 80, 30, .45); border-radius: 0 0 3px 3px; }
.wz-chat-log { height: 150px; overflow-y: auto; padding: 14px 2px 2px 0; display: flex; flex-direction: column; gap: 5px; scrollbar-width: thin; scrollbar-color: rgba(110, 80, 30, .4) transparent;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22px); mask-image: linear-gradient(180deg, transparent 0, #000 22px); }
.wz-chat-log > :first-child { margin-top: auto; }
.wz-chat[data-tab="friends"] .wz-msg.ch-world { display: none; }
.wz-msg { font: 600 13px/1.32 var(--font-ui); color: var(--parch-ink); overflow-wrap: anywhere; }
.wz-msg time { display: none; }
.wz-msg em { font: 700 8.5px/1 var(--font-mono); font-style: normal; letter-spacing: .12em; text-transform: uppercase; color: #1d7d61; margin-right: 5px; vertical-align: 1px; }
.wz-msg-n { border: 0; background: none; padding: 0; margin-right: 5px; font: italic 600 13.5px/1 var(--font-display) !important; font-variation-settings: 'opsz' 14; color: var(--ink, #4a33a8) !important; }
.wz-msg-n:hover { text-decoration: underline; text-underline-offset: 2px; }
.wz-msg.me .wz-msg-n { color: #3a2896 !important; }
.wz-msg-n .stu { display: inline-block; width: 5px; height: 5px; margin: 0 5px 2px 0; background: #6b4fd8; transform: rotate(45deg); vertical-align: middle; }
.wz-fr-tag { display: inline-flex; align-items: center; gap: 3px; margin-right: 5px; padding: 1px 5px 1px 3px; border-radius: 3px; vertical-align: 1px;
  font: 700 8.5px/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--brass-ink); background: linear-gradient(180deg, #fbe7ad, #d9ae58); box-shadow: 0 0 0 1px rgba(90, 61, 16, .7); }
.wz-social .wz-fr-tag svg { width: 9px; height: 9px; fill: #4a3210; stroke: none; }
.wz-msg.sys { display: flex; align-items: center; gap: 8px; margin: 2px -4px; padding: 6px 8px; border-radius: 4px; font-size: 12.5px; color: #f6f1ff;
  background: var(--enamel); box-shadow: inset 0 1px 0 rgba(200, 185, 255, .35), inset 0 -2px 6px rgba(10, 5, 40, .5); }
.wz-social .wz-msg.sys svg { flex: none; width: 14px; height: 14px; fill: #f4d27a; stroke: none; }
.wz-chat-form { display: flex; align-items: center; gap: 8px; height: 32px; margin-top: 9px; padding: 0 6px 0 10px; border-radius: 4px;
  background: rgba(255, 252, 242, .6); box-shadow: inset 0 1px 2px rgba(90, 60, 20, .35), 0 0 0 1px rgba(110, 80, 30, .4); }
.wz-chat-form:focus-within { background: rgba(255, 252, 242, .9); box-shadow: inset 0 1px 2px rgba(90, 60, 20, .35), 0 0 0 1px #6b4fd8, 0 0 0 3px rgba(107, 79, 216, .18); }
.wz-social .wz-quill { flex: none; width: 15px; height: 15px; color: var(--parch-ink-2); stroke-width: 1.3; }
.wz-chat-in { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; color: var(--parch-ink); font: 600 12.5px var(--font-ui); outline: none; }
.wz-chat-in::placeholder { color: rgba(42, 34, 54, .5); }
.wz-chat-key .key { height: 18px; font-size: 10px; }
.wz-social.typing .wz-chat-key { display: none; }
.wz-chat.collapsed .wz-chat-body { display: none; }
.wz-chat.collapsed .wz-chat-head { cursor: pointer; border-radius: 5px; }
.wz-chat.collapsed .wz-chat-x { transform: rotate(180deg); }
.wz-chat-fab { display: none; }

/* ---------- kartu pemain (mengikuti kepala) ---------- */
.wz-pcard { position: absolute; left: 0; top: 0; width: 286px; padding-bottom: 16px; pointer-events: auto; z-index: 5; opacity: 0; transition: opacity .18s; }
.wz-pcard.in { opacity: 1; }
.wz-pc { position: relative; padding: 14px 14px 12px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(110, 80, 30, .55), 0 16px 30px -12px rgba(20, 12, 0, .65); }
.wz-corner { position: absolute; width: 16px; height: 16px; pointer-events: none; }
.wz-corner::before { content: ''; position: absolute; inset: 0; border: 2.5px solid #c99a45; border-right: 0; border-bottom: 0; filter: drop-shadow(0 1px 0 rgba(74, 50, 16, .9)); }
.wz-corner.tl { left: 3px; top: 3px; } .wz-corner.tr { right: 3px; top: 3px; transform: scaleX(-1); }
.wz-corner.bl { left: 3px; bottom: 3px; transform: scaleY(-1); } .wz-corner.br { right: 3px; bottom: 3px; transform: scale(-1); }
.wz-pc-top { display: flex; align-items: center; gap: 11px; }
.wz-pc-av { position: relative; flex: none; width: 50px; height: 50px; border-radius: 50%; background: var(--knurl); }
.wz-pc-av::before { content: ''; position: absolute; inset: 2.5px; border-radius: 50%; background: var(--brass-ring); }
.wz-pc-av::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--robe) 70%, #efe2c4) 0 38%, #efe2c4 39%); box-shadow: 0 0 0 1px #3a2708; }
.wz-social .wz-pc-av svg { position: absolute; z-index: 2; left: 7px; top: 8px; width: 36px; height: 36px; stroke: none; }
.wz-pc-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wz-pc-id b { font: 600 20px/1.05 var(--font-display); font-variation-settings: 'opsz' 36; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wz-pc-id span { display: flex; align-items: center; gap: 7px; margin-top: 5px; font: 700 12px/1 var(--font-ui); color: var(--parch-ink-2); white-space: nowrap; }
.wz-pc-id .jewel { width: 7px; height: 7px; }
.wz-pc-role { align-self: flex-start; flex: none; display: grid; justify-items: center; align-content: center; gap: 1px; width: 42px; height: 46px; padding-top: 1px; color: #fff7e2;
  clip-path: polygon(50% 0, 100% 14%, 100% 76%, 50% 100%, 0 76%, 0 14%); background: var(--enamel); }
.wz-social .wz-pc-role svg { width: 17px; height: 17px; stroke: #f2d48a; stroke-width: 1.4; }
.wz-pc-role small { font: 700 6.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: #e9c977; }
.wz-pc-x { position: absolute; right: 6px; top: 5px; width: 20px; height: 20px; border: 0; border-radius: 3px; background: none; display: grid; place-items: center; color: rgba(74, 50, 16, .55); }
.wz-pc-x:hover { color: #4a3210; background: rgba(120, 90, 40, .12); }
.wz-social .wz-pc-x svg { width: 11px; height: 11px; stroke-width: 1.8; }
.wz-pc-top .wz-pc-role { margin-right: 14px; }
.wz-pc-row { display: flex; gap: 7px; margin-top: 12px; }
.wz-pc-b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 6px; white-space: nowrap;
  font: 800 12.5px/1 var(--font-ui) !important; letter-spacing: .01em; color: var(--parch-ink); transition: filter .15s, background .15s; }
.wz-social .wz-pc-b svg { width: 14px; height: 14px; flex: none; stroke-width: 1.4; }
.wz-pc-b.ghost { background: rgba(120, 90, 40, .08); box-shadow: inset 0 0 0 1px rgba(110, 80, 30, .45); }
.wz-pc-b.ghost:hover:not(:disabled) { background: rgba(120, 90, 40, .16); }
.wz-pc-b.enamel { flex: 1; color: #fff; background: var(--enamel); box-shadow: inset 0 1px 0 rgba(210, 195, 255, .45), 0 0 0 1px #2a1c6a, 0 0 0 2.5px #e2bd6b, 0 0 0 3.5px #6f4c14; }
.wz-pc-b.enamel:hover { filter: brightness(1.12); }
.wz-pc-b.on, .wz-pc-b:disabled { flex: 1; cursor: default; }
.wz-pc-b.on { color: #1d6d55; box-shadow: inset 0 0 0 1px rgba(29, 125, 97, .55); background: rgba(95, 211, 176, .14); }
.wz-pc-b:disabled:not(.on) { opacity: .7; }
.wz-pc-tip { position: absolute; left: 50%; bottom: 0; margin-left: -12px; width: 24px; height: 18px; background: #6f4c14; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.wz-pc-tip::before { content: ''; position: absolute; left: 2px; right: 2px; top: 0; height: 15px; background: linear-gradient(90deg, #f8e2a2, #c99a45 50%, #8a611e); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.wz-pc-tip::after { content: ''; position: absolute; left: 6px; right: 6px; top: 0; height: 7px; background: #f5ecd6; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.wz-pc-dot { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--robe); box-shadow: inset 0 -4px 0 rgba(0,0,0,.18), 0 0 0 2px #fff, 0 0 0 3px rgba(31,27,46,.12); }

/* ---------- daftar teman ---------- */
.wz-friends {
  position: absolute; right: var(--sr); top: calc(var(--st) + 100px); width: 340px; max-height: calc(100% - var(--st) - var(--sb) - 110px); overflow-y: auto;
  pointer-events: auto; padding: 14px 14px 16px; border-radius: 18px; background: var(--snow, #fffdf8); color: var(--ink, #1f1b2e);
  box-shadow: 0 30px 60px -24px rgba(20,16,40,.6), 0 0 0 1px rgba(31,27,46,.08);
}
.wz-friends header { display: flex; align-items: baseline; gap: 8px; }
.wz-friends h3 { margin: 0; font: 600 22px var(--font-display); }
.wz-friends header .mono { font-size: 12px; color: var(--ink-3, #6f6889); }
.wz-fr-x { margin-left: auto; border: 0; background: none; font-size: 20px; opacity: .5; }
.wz-friends h4 { margin: 14px 0 6px; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3, #6f6889); }
.wz-fr-code { margin-top: 10px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--violet) 8%, #fff); }
.wz-fr-code span { font-size: 12px; font-weight: 700; color: var(--ink-3, #6f6889); }
.wz-fr-code b { font-size: 15px; letter-spacing: .06em; margin-left: auto; }
.wz-friends button { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(31,27,46,.14); background: #fff; font-size: 12px; font-weight: 800; }
.wz-friends button.gold { background: #f4b740; border-color: #d99a1c; }
.wz-friends button.ghost { background: none; border-color: transparent; color: var(--ink-3, #6f6889); }
.wz-friends button.arm { color: #c0392b; }
.wz-fr-add { display: flex; gap: 6px; margin-top: 8px; }
.wz-fr-add input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid rgba(31,27,46,.16); font: 600 13px var(--font-mono); text-transform: uppercase; }
.wz-fr-add input::placeholder { text-transform: none; font-family: var(--font-ui); }
.wz-friends ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wz-friends li { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 12px; }
.wz-friends li:hover { background: rgba(31,27,46,.04); }
.wz-friends li div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wz-friends li b { font-size: 14px; }
.wz-friends li span:not(.wz-fr-acts):not(.wz-pc-dot) { font-size: 11.5px; color: var(--ink-3, #6f6889); font-weight: 700; }
.wz-friends li em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink-2, #4a4466); }
.wz-friends li.off { opacity: .6; }
.wz-friends li .wz-pc-dot { width: 26px; height: 26px; }
.wz-friends i.live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3fbf8f; margin-right: 5px; vertical-align: 1px; }
.wz-fr-acts { display: flex; gap: 4px; }
.wz-fr-empty { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-3, #6f6889); }

/* layar sempit / pendek: chat lebih ringkas */
.wz-hud.compact .wz-chat-log { height: 110px; }
@media (max-height: 820px) { .wz-chat-log { height: 120px; } }

/* ---------- HP: tombol chat perkamen di gugus tombol kanan bawah, panel di tengah bawah ---------- */
/* layar ringkas: kartu pemain diperkecil dari titik tumpu (ekor) supaya tidak menutup instrumen */
.wz-hud.compact .wz-pc { transform: scale(.8); transform-origin: 50% 100%; }
.wz-hud.compact .wz-pcard { width: 280px; }

.is-touch .wz-chat-fab {
  display: block; position: absolute; right: calc(var(--sr) + 66px); bottom: calc(var(--sb) + 84px); width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; pointer-events: auto;
  background: var(--knurl); box-shadow: 0 6px 10px -3px rgba(10, 5, 0, .6);
}
.is-touch .wz-chat-fab::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--brass-ring); }
.is-touch .wz-chat-fab .face { position: absolute; inset: 5px; border-radius: 50%; display: grid; place-items: center; color: var(--parch-ink);
  background-color: var(--parch); background-image: var(--grain); box-shadow: 0 0 0 1.5px #5a3d10, inset 0 -3px 6px rgba(120, 90, 40, .25); }
.is-touch .wz-chat-fab svg { width: 20px; height: 20px; stroke-width: 1.6; }
.is-touch .wz-chat-fab .wz-chat-badge { position: absolute; right: -3px; top: -3px; z-index: 2; }
.is-touch .wz-chat { left: 50%; bottom: calc(var(--sb) + 2px); transform: translateX(-50%); width: min(340px, 42vw); }
.is-touch .wz-chat.collapsed { display: none; }
.is-touch .wz-chat-log { height: min(130px, 30vh); }
.is-touch .wz-chat-key { display: none; }
.is-touch .wz-friends { top: var(--st); max-height: calc(100% - var(--st) - var(--sb)); right: calc(var(--sr) + 114px); width: min(340px, 52vw); }
