/* social.css — the chat window (js/chat.js), who is online (js/net.js) and player shops (js/vend.js). Sizes in --u
   like style.css; the windows reuse shop.css's card, tabs, grid cells and prices. */

/* Game activity has its own history in the บันทึก tab. */
#log { display: none !important; }

/* ---------- the chat window (bottom left) ---------- */
.chatwin {
  position: absolute; left: calc(16 * var(--u)); bottom: calc(24 * var(--u)); width: calc(540 * var(--u)); display: flex; flex-direction: column;
  pointer-events: auto; border-radius: calc(14 * var(--u)); background: rgba(20, 17, 30, 0.5); border: calc(3 * var(--u)) solid rgba(42, 36, 53, 0.85);
  box-shadow: 0 calc(4 * var(--u)) 0 rgba(0, 0, 0, 0.18); transition: background 0.2s ease;
  font: 400 calc(16 * var(--u)) / 1.5 'Mitr', sans-serif; color: #e8f7ff;
}
.chatwin:hover, .chatwin.typing { background: rgba(20, 17, 30, 0.84); }
.cw-tabs { display: flex; align-items: flex-end; gap: calc(3 * var(--u)); padding: calc(9 * var(--u)) calc(8 * var(--u)) 0; overflow-x: auto; scrollbar-width: none; }
.cw-tabs::-webkit-scrollbar { display: none; }
.cw-tabs button {
  position: relative; flex: none; white-space: nowrap; cursor: pointer; padding: 0 calc(7 * var(--u)); border: 0; border-radius: calc(8 * var(--u)) calc(8 * var(--u)) 0 0;
  background: rgba(74, 69, 85, 0.75); color: #c8e1ee; font: 500 calc(15 * var(--u)) / 1.75 'Mitr', sans-serif;
}
.cw-tabs button:hover { color: #e8f7ff; }
.cw-tabs button.on { background: #23516b; color: var(--ink); }
.cw-tabs button b {
  position: absolute; top: calc(-9 * var(--u)); right: calc(-7 * var(--u)); min-width: calc(19 * var(--u)); padding: 0 calc(4 * var(--u));
  border-radius: calc(10 * var(--u)); background: #ff6b8a; border: calc(2 * var(--u)) solid #37637b; color: #e8f7ff;
  font: 700 calc(12 * var(--u)) / 1.4 'Baloo 2', sans-serif; text-align: center;
}
.cw-tabs button b:empty { display: none; }
.cw-tabs .cw-size { margin-left: auto; width: calc(34 * var(--u)); padding: 0; border-radius: calc(8 * var(--u)) calc(8 * var(--u)) 0 0; }
.cw-size::before { content: '\2195'; font-size: calc(17 * var(--u)); }
.cw-history { display: flex; align-items: center; gap: calc(8 * var(--u)); padding: calc(5 * var(--u)) calc(10 * var(--u)); background: rgba(24, 20, 36, 0.55); font-size: calc(12 * var(--u)); }
.cw-history[hidden], .cw-history button[hidden] { display: none; }
.cw-history span { flex: 1; min-width: 0; color: #c8e1ee; }
.cw-history button { flex: none; cursor: pointer; padding: calc(2 * var(--u)) calc(7 * var(--u)); border: 1px solid #a88a55; border-radius: calc(6 * var(--u)); background: #081b2b; color: #e8f7ff; font: inherit; }
.cw-history button:disabled { cursor: default; opacity: 0.55; }
.cw-history button:focus-visible { outline: 2px solid #416e87; outline-offset: 2px; }
.cw-list {
  height: calc(208 * var(--u)); overflow-y: auto; padding: calc(4 * var(--u)) calc(12 * var(--u)); scrollbar-width: thin;
  scrollbar-color: rgba(255, 216, 115, 0.5) transparent; border-top: calc(2 * var(--u)) solid rgba(255, 216, 115, 0.4);
}
.chatwin.size-s .cw-list { height: calc(104 * var(--u)); }
.chatwin.size-l .cw-list { height: calc(364 * var(--u)); }
.cw-empty { color: #c8e1ee; padding: calc(12 * var(--u)) 0; }
.cw-tabs button[data-tab="sys"] { margin-left: auto; border-left: calc(2 * var(--u)) solid #3c7d98; }
.cw-tabs .cw-size { margin-left: 0; }
/* a person's whisper room (js/chat.js rooms): the whisper's pink, its name, a × to close it */
.cw-tabs .cw-room { color: #c8e1ee; max-width: calc(130 * var(--u)); overflow: visible; }
.cw-tabs .cw-room.on { background: #17364b; color: var(--ink); }
.cw-tabs .cw-room .cw-x { font-style: normal; margin-left: calc(5 * var(--u)); padding: 0 calc(3 * var(--u)); border-radius: calc(4 * var(--u)); opacity: 0.75; }
.cw-tabs .cw-room .cw-x:hover { opacity: 1; background: rgba(0, 0, 0, 0.25); }
.cw-tabs button:focus-visible, .cw-chip:focus-visible { outline: 2px solid #416e87; outline-offset: 2px; }
.cl { overflow-wrap: anywhere; text-shadow: 0 calc(1 * var(--u)) calc(2 * var(--u)) rgba(0, 0, 0, 0.7); }
.cl i { font-style: normal; margin-right: calc(5 * var(--u)); }
.cl b { font-weight: 600; }
.cl .nm { cursor: pointer; }
.cl .nm:hover { text-decoration: underline; }
.cl.ca b { color: #e8f7ff; }
.cl.cm { color: #c8e1ee; }
.cl.cm i { color: #c8e1ee; }
.cl.cp { color: #e8f7ff; }
.cl.cp i { color: #c8e1ee; }
.cl.cg { color: #c8e1ee; }
.cl.cg i { color: #ffb35c; }
.cl.cw { color: #e8f7ff; }
.cl.cw i { color: #c8e1ee; }
.cl.mine b { color: #c8e1ee; }
/* a megaphone line (ร้านเพชร's โทรโข่ง, js/gemshop.js): gold on the whole row, the megaphone's picture before the name */
.cl.mega { color: #e8f7ff; background: linear-gradient(90deg, #ffd45e, #17364b); text-shadow: none; padding: 0 calc(4 * var(--u)); border-radius: calc(3 * var(--u)); }
.cl.mega b, .cl.mega.mine b { color: #ccb59e; }
.cl.mega .cl-mega { width: calc(16 * var(--u)); height: calc(16 * var(--u)); object-fit: contain; vertical-align: -0.2em; margin-right: calc(3 * var(--u)); }
/* the staff line of the in-game announcements (js/chat.js .cl.staff; the touch mirror's .ann-row, js/sq/hud.js): the
   staff look of docs/team/ingame-announcements-20261123/look.json, a near-white fill, dark ink, a 2 px border and the
   level's badge holding a shield and "ประกาศ" / "Notice". Never the megaphone line's gold or the paid strip's navy. */
.cl.staff, .ann-row.staff {
  --ann-badge: #185776; background: #10283b; color: #e8f7ff; border: 2px solid var(--ann-badge); text-shadow: none;
  padding: 0 4px; border-radius: 3px;
}
.cl.staff.lv-normal, .ann-row.staff.lv-normal { --ann-badge: #185776; }
.cl.staff.lv-event, .ann-row.staff.lv-event { --ann-badge: #185776; }
.cl.staff.lv-warning, .ann-row.staff.lv-warning { --ann-badge: #b35300; }
.cl.staff.lv-urgent, .ann-row.staff.lv-urgent { --ann-badge: #c8213a; }
/* (2 px and the space js/chat.js puts after the badge: the same gap, and the line's text reads "ประกาศ <words>") */
.cl-badge {
  display: inline-flex; align-items: center; gap: 3px; vertical-align: 0.05em; margin-right: 2px; padding: 0 5px;
  border-radius: 2px; background: var(--ann-badge); color: #e8f7ff; font-weight: 700; font-size: 0.86em; line-height: 1.5;
}
.cl-badge svg { width: 1em; height: 1em; flex: none; }
.cl.bot b { color: #e8f7ff; }
.cl.cs { color: #c8e1ee; font-size: 0.94em; }
.cl.cs.exp { color: #c8e1ee; }
.cl.cs.item { color: #c8e1ee; }
.cl.cs.level { color: #c8e1ee; font-weight: 600; }
.cl.cs.job { color: #c8e1ee; }
.cl.cs.warn { color: #c8e1ee; }
.cw-in { display: flex; gap: calc(6 * var(--u)); padding: calc(6 * var(--u)) calc(8 * var(--u)) calc(8 * var(--u)); border-top: calc(2 * var(--u)) solid rgba(42, 36, 53, 0.85); }
.cw-chip {
  flex: none; max-width: calc(180 * var(--u)); cursor: pointer; padding: 0 calc(10 * var(--u)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-radius: calc(9 * var(--u)); border: calc(2 * var(--u)) solid #37637b; font: 600 calc(15 * var(--u)) / 1.8 'Mitr', sans-serif; color: var(--ink);
}
.cw-chip.ca { background: #10283b; }
.cw-chip.cA { background: #ffd45e; }
.cw-chip.cm { background: #23516b; }
.cw-chip.cw { background: #17364b; }
.cw-chip.cp { background: #185776; }
.cw-chip.cg { background: #ffb35c; }
.cw-in input {
  flex: 1; min-width: 0; padding: 0 calc(10 * var(--u)); border-radius: calc(9 * var(--u)); border: calc(2 * var(--u)) solid #37637b;
  background: rgba(255, 250, 240, 0.14); color: #e8f7ff; font: 400 calc(16 * var(--u)) / 1.9 'Mitr', sans-serif; outline: none;
}
.cw-in input::placeholder { color: rgba(244, 239, 230, 0.6); }
.chatwin.typing .cw-in input { background: #10283b; color: #e8f7ff; }
.chatwin.typing .cw-in input::placeholder { color: #a7c5d9; }
@media (max-aspect-ratio: 7/5) { .chatwin { bottom: calc(168 * var(--u)); width: calc(640 * var(--u)); } }

/* ---------- who is online (under the minimap) ---------- */
.netlist {
  position: absolute; right: calc(18 * var(--u)); top: calc(360 * var(--u)); max-width: calc(330 * var(--u)); padding: calc(6 * var(--u)) calc(12 * var(--u));
  border-radius: calc(12 * var(--u)); background: rgba(24, 20, 36, 0.72); border: calc(3 * var(--u)) solid #37637b; color: #e8f7ff;
  font: 400 calc(16 * var(--u)) / 1.45 'Mitr', sans-serif; text-align: right;
}
.netlist .net-h { color: #c8e1ee; font-weight: 500; }
.netlist .net-p b { font-weight: 500; }
.netlist .net-p span { color: #c8e1ee; }

/* ---------- player shops ---------- */
.card.shop.vend, .card.shop.vbuy { width: min(96vw, calc(1060 * var(--u))); }
.vd-title { display: flex; align-items: center; gap: calc(12 * var(--u)); margin-bottom: calc(12 * var(--u)); }
.vd-title label { font: 600 calc(19 * var(--u)) 'Mitr', sans-serif; color: #e8f7ff; white-space: nowrap; }
.vd-title input, .vd-qty input, .vd-price input {
  min-width: 0; padding: 0 calc(10 * var(--u)); border-radius: calc(9 * var(--u)); border: calc(3 * var(--u)) solid #37637b; background: #10283b; color: #e8f7ff;
  font: 500 calc(17 * var(--u)) / 1.7 'Mitr', sans-serif; outline: none;
}
.vd-title input { flex: 1; }
.vd-title input:focus, .vd-qty input:focus, .vd-price input:focus { box-shadow: 0 0 0 calc(3 * var(--u)) #416e87; }
.vd-wrap { display: grid; grid-template-columns: calc(380 * var(--u)) 1fr; gap: calc(16 * var(--u)); }
.vd-bag { display: flex; flex-direction: column; min-width: 0; }
.vd-grid { max-height: calc(420 * var(--u)); align-content: start; }
.vd-list { display: flex; flex-direction: column; gap: calc(7 * var(--u)); max-height: calc(470 * var(--u)); overflow-y: auto; padding: calc(4 * var(--u)); }
.vd-h { font: 600 calc(18 * var(--u)) / 1.5 'Mitr', sans-serif; color: #c8e1ee; }
.vd-row {
  display: grid; grid-template-columns: calc(54 * var(--u)) minmax(0, 1fr) auto auto auto; align-items: center; gap: calc(10 * var(--u));
  padding: calc(6 * var(--u)) calc(10 * var(--u)); border-radius: calc(12 * var(--u)); border: calc(3 * var(--u)) solid #37637b;
  background: linear-gradient(#16445c, #081b2b); box-shadow: inset 0 0 0 calc(2 * var(--u)) #a88a55;
}
.vend .vd-open ~ .vd-list .vd-row { grid-template-columns: calc(54 * var(--u)) minmax(0, 1fr) auto auto; }
.vbuy .vd-row { grid-template-columns: calc(54 * var(--u)) minmax(0, 1fr) auto auto auto auto; }
.vd-row > img { width: calc(52 * var(--u)); height: calc(52 * var(--u)); object-fit: contain; }
.vd-name { display: flex; flex-direction: column; min-width: 0; font: 600 calc(18 * var(--u)) / 1.3 'Mitr', sans-serif; color: #e8f7ff; }
.vd-name small { font: 400 calc(13 * var(--u)) / 1.4 'Mitr', sans-serif; color: #c8e1ee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vd-qty { display: flex; align-items: center; gap: calc(4 * var(--u)); font: 700 calc(18 * var(--u)) 'Baloo 2', sans-serif; }
.vd-qty span { min-width: calc(30 * var(--u)); text-align: center; }
.vd-qty button, .vd-del {
  width: calc(30 * var(--u)); height: calc(30 * var(--u)); padding: 0; cursor: pointer; border-radius: calc(8 * var(--u)); border: calc(3 * var(--u)) solid #37637b;
  background: #23516b; color: var(--ink); font: 800 calc(18 * var(--u)) / 1 'Baloo 2', sans-serif;
}
.vd-qty input { width: calc(64 * var(--u)); text-align: center; }
.vd-price { display: flex; align-items: center; gap: calc(4 * var(--u)); }
.vd-price img { width: calc(28 * var(--u)); height: calc(28 * var(--u)); }
.vd-price input { width: calc(118 * var(--u)); text-align: right; }
.vd-del { background: #17364b; }
.vd-left { font-size: calc(16 * var(--u)); color: #c8e1ee; white-space: nowrap; }
.vd-left b { color: #e8f7ff; }
.vd-row .sh-price { grid-area: auto; font-size: calc(22 * var(--u)); white-space: nowrap; } /* (shop.css names it an area of its own grid) */
.vd-empty { padding: calc(24 * var(--u)); text-align: center; color: #a7c5d9; }
.vd-foot { display: flex; align-items: center; gap: calc(14 * var(--u)); margin-top: calc(12 * var(--u)); font-size: calc(15 * var(--u)); color: #c8e1ee; }
.vd-foot .big { margin: 0 0 0 auto; padding: calc(2 * var(--u)) calc(24 * var(--u)); font-size: calc(20 * var(--u)); white-space: nowrap; }
.vd-open { margin-bottom: calc(10 * var(--u)); font-size: calc(18 * var(--u)); color: #e8f7ff; }
.vd-open b { color: #e8f7ff; }
.vd-open em { font-style: normal; font-weight: 600; color: #c8e1ee; }
.vb-by { margin-bottom: calc(10 * var(--u)); font-size: calc(17 * var(--u)); color: #c8e1ee; }
.vb-buy {
  cursor: pointer; padding: calc(2 * var(--u)) calc(14 * var(--u)); border-radius: calc(10 * var(--u)); border: calc(3 * var(--u)) solid #37637b;
  background: #23516b; color: var(--ink); font: 700 calc(17 * var(--u)) / 1.6 'Mitr', sans-serif; white-space: nowrap;
}
.vb-buy:disabled { opacity: 0.4; cursor: default; }
.vb-status { margin-top: calc(10 * var(--u)); min-height: 1.6em; font-size: calc(16 * var(--u)); color: #c8e1ee; }
.vb-status.ok { color: #c8e1ee; }
.vb-status.warn { color: #c8e1ee; }
.vend-pill {
  position: absolute; left: 50%; bottom: calc(150 * var(--u)); transform: translateX(-50%); pointer-events: auto; cursor: pointer; white-space: nowrap;
  padding: calc(3 * var(--u)) calc(18 * var(--u)); border-radius: calc(16 * var(--u)); border: calc(3 * var(--u)) solid #37637b;
  background: linear-gradient(#b27842, #8a5a34); color: #e8f7ff; box-shadow: inset 0 0 0 calc(2 * var(--u)) rgba(255, 214, 150, 0.5);
  font: 600 calc(17 * var(--u)) / 1.6 'Mitr', sans-serif;
}
@media (max-aspect-ratio: 7/5) {
  .vd-wrap { grid-template-columns: 1fr; }
  .vend-pill { bottom: calc(300 * var(--u)); }
}
