/* Игровые системы: диалоги подтверждения, сортировка сумки, сравнение вещей, чат с вкладками,
   окно «Группа и друзья», история и авто-путь заданий, перетаскивание умений. Стиль — windows.css. */

/* ---------- модальные диалоги (client/confirm.js) ---------- */
#dlg { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; height: var(--app-h, 100%);
  padding: calc(8px + var(--sat, 0px)) calc(12px + var(--sar, 0px)) calc(8px + var(--sab, 0px)) calc(12px + var(--sal, 0px)); box-sizing: border-box;
  background: rgba(0, 0, 0, 0.58); touch-action: manipulation; }
#dlg.hidden { display: none; }
.dlg-box { width: min(420px, 100%); max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 14px 14px 12px; }
.dlg-t { margin: 0 34px 8px; text-align: center; color: #fff; font-size: 15px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.dlg-x { text-align: center; font-size: 13px; color: #d6dbe3; line-height: 1.45; }
.dlg-cb { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin-top: 6px; font-size: 13px; color: #c3cbd6; cursor: pointer; }
.dlg-cb input { width: 22px; height: 22px; margin: 0; accent-color: #3a7fe0; }
.dlg-cb i { display: none; }
.dlg-btns { display: flex; gap: 10px; margin-top: 10px; }
.dlg-btns button, .dlg-opts button {
  flex: 1; min-height: 44px; padding: 0 12px; border-radius: 3px; border: 1px solid #9fb2cc; color: #fff; font: 700 13px -apple-system, system-ui, sans-serif;
  background: linear-gradient(#2c5fae, #173a73 55%, #0f2650); box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 0 0 1px #000; }
.dlg-btns .go { border-color: #ffd27a; background: linear-gradient(#3a7fe0, #1d50a8 55%, #133a7c); }
.dlg-btns .danger { border-color: #ffb08a; background: linear-gradient(#c8442a, #7a1a0c 60%, #4a0e06); }
.dlg-btns .cancel { border-color: #d88a7a; background: linear-gradient(#9a2a1e, #5e140c 60%, #3c0b06); }
.dlg-opts { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.dlg-opts button { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 12px; text-align: center; }
.dlg-opts button i { font-style: normal; font-weight: 400; font-size: 11.5px; color: #c3d2e6; line-height: 1.3; }
.dlg-opts button:disabled, .dlg-btns button:disabled { filter: grayscale(0.8) brightness(0.6); }
.dlg-box button:active:not(:disabled) { filter: brightness(1.3); }

/* ---------- сумка: кнопка «Сортировка» слева в шапке, шаг вложения очков ---------- */
.wn-tool { grid-column: 1; grid-row: 1; justify-self: start; position: relative; z-index: 5; width: 44px; height: 44px; margin: 0 0 0 3px; padding: 0; border-radius: 3px;
  border: 2px solid #8c97a5; background: var(--wn-glass); color: var(--pal-leg, #ffa640);
  box-shadow: inset 0 0 0 1px #000, inset 0 3px 0 rgba(255,255,255,0.28), 0 0 0 1px #000, 0 2px 4px rgba(0,0,0,0.6); }
.wn-tool svg { width: 62%; height: 62%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px #000); }
.wn-tool:active { filter: brightness(1.3); }
.ch-free { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ch-step { display: inline-flex; gap: 4px; margin-left: auto; }
.ch-step button { min-width: 44px; height: 44px; padding: 0 6px; border-radius: 3px; border: 1px solid #6b7686; background: #121821; color: #c3cbd6; font: 700 12px system-ui, sans-serif; }
.ch-step button.on { border-color: #ffd27a; color: #ffd27a; box-shadow: inset 0 0 8px rgba(255,210,120,0.35); }

/* подсказка: сравнение с надетым, только просмотр (ссылка из чата) */
.tip .t-cmp-h { font-size: 12px !important; opacity: 0.85; }
.tip .t-cmp { font-weight: 700; }
.tip.ro .t-btns { display: none; }
.tip .t-btns { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- чат (client/chat.js) ---------- */
#chat-win { position: fixed; inset: 0; z-index: 14; height: var(--app-h, 100%); pointer-events: auto; background: rgba(0,0,0,0.25); }
#chat-win.hidden { display: none; }
#chat-win .ct-box { position: absolute; left: var(--sal, 0px); top: 0; bottom: 0; width: min(460px, 62vw); height: var(--app-h, 100%); }
.ct-tabs { flex: none; display: flex; gap: 2px; padding: 0 6px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid #000; }
.ct-tabs::-webkit-scrollbar { display: none; }
.ct-tabs button { flex: 1 0 auto; min-height: 44px; min-width: 44px; padding: 0 8px; border: 0; background: none; color: #8a94a3; font: 700 12px -apple-system, system-ui, sans-serif; }
.ct-tabs button.on { color: #e9eef5; box-shadow: inset 0 -2px 0 #ffd27a; text-shadow: 0 0 8px rgba(120,170,255,0.6); }
.ct-log { font-size: 12.5px; line-height: 1.45; padding: 4px 8px; }
.ct-row { padding: 3px 2px; border-bottom: 1px solid rgba(255,255,255,0.04); color: #ececec; word-break: break-word; }
.ct-row[data-n] { cursor: pointer; }
.ct-row[data-n]:active { background: rgba(120,170,255,0.12); }
.ct-row > em { font-style: normal; font-size: 11px; color: #6f7a88; margin-right: 5px; }
.ct-row .nk { color: var(--pal-nick, #ffb648); }
.ct-row.sys, .ct-row.c-sys { color: rgba(255,255,255,0.75); }
.ct-row.warn { color: #ff6464; } .ct-row.info { color: #7fd4ff; }
.ct-tag { font-style: normal; font-weight: 700; }
.ct-link { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; padding: 0 2px; border: 0; background: none; font: 700 12.5px -apple-system, system-ui, sans-serif; text-decoration: underline dotted; vertical-align: middle; }
.ct-empty { padding: 16px 8px; text-align: center; color: #8a94a3; font-size: 12.5px; }
.ct-in { flex: none; display: flex; gap: 6px; padding: 6px 8px calc(6px + var(--sab, 0px)); border-top: 1px solid #000; box-shadow: inset 0 1px 0 #39424d; }
.ct-in input { flex: 1; min-width: 0; height: 44px; padding: 0 10px; box-sizing: border-box; border-radius: 3px; border: 1px solid #3b434e; background: #0a0d11; color: #fff; font: 15px -apple-system, system-ui, sans-serif; }
.ct-ch { flex: none; min-width: 64px; max-width: 96px; height: 44px; padding: 0 6px; border-radius: 3px; border: 1px solid #6b7686; background: #121821; font: 700 12px system-ui, sans-serif; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ct-send { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 3px; border: 1px solid #c4d3e8; background: var(--wn-blue); }
.ct-send svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linejoin: round; }
#btn-chat { position: relative; }
#btn-chat[data-unread]:not([data-unread=""])::after { content: attr(data-unread); position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 3px; box-sizing: border-box;
  border-radius: 8px; background: #d8243a; color: #fff; font: 700 11px/16px system-ui, sans-serif; text-align: center; box-shadow: 0 0 0 1px #000; pointer-events: none; }

/* ---------- Группа и друзья (client/social.js) ---------- */
#soc-win { position: fixed; inset: 0; z-index: 14; height: var(--app-h, 100%); background: rgba(0,0,0,0.45); display: flex; justify-content: center; }
#soc-win.hidden { display: none; }
#soc-win .so-box { width: min(520px, calc(100vw - var(--sal, 0px) - var(--sar, 0px) - 16px)); height: var(--app-h, 100%); }
.so-body { padding: 6px 10px 10px; }
.so-row { display: flex; align-items: center; gap: 8px; padding: 6px; margin-bottom: 4px; background: var(--wn-cell); border: 1px solid var(--wn-cell-line); border-radius: 2px; }
.so-row.me { border-color: #4a5b74; }
.so-row.dead, .so-row.off { opacity: 0.6; }
.so-ic { flex: none; width: 30px; text-align: center; font-size: 20px; }
.so-info { flex: 1; min-width: 0; }
.so-n { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-n b { color: #fff; } .so-n em { font-style: normal; color: #9aa4b2; font-size: 12px; }
.so-crown { font-style: normal; color: #ffd24a; margin-right: 3px; }
.so-dot { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; background: #5a626e; vertical-align: 1px; }
.so-dot.on { background: #5ee06a; box-shadow: 0 0 6px #5ee06a; }
.so-hp { height: 5px; margin: 3px 0 2px; background: #2a0c10; border-radius: 2px; overflow: hidden; }
.so-hp i { display: block; height: 100%; background: linear-gradient(#ff5a6a, #c01a2a); }
.so-z { font-size: 11.5px; color: #7fd4ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-btns { flex: none; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 52%; }
.so-btns button, .so-acts button, .so-add button, .so-seg button {
  min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 3px; border: 1px solid #9fb2cc; color: #fff; font: 700 12.5px -apple-system, system-ui, sans-serif;
  background: linear-gradient(#2c5fae, #173a73 55%, #0f2650); box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 0 0 1px #000; }
.so-body .go, .so-seg button.on { border-color: #ffd27a; background: linear-gradient(#3a7fe0, #1d50a8 55%, #133a7c); }
.so-body .danger { border-color: #d88a7a; background: linear-gradient(#9a2a1e, #5e140c 60%, #3c0b06); }
.so-body button:disabled { filter: grayscale(0.8) brightness(0.6); }
.so-body button:active:not(:disabled) { filter: brightness(1.3); }
.so-add { display: flex; gap: 6px; margin: 6px 0; }
.so-add input { flex: 1; min-width: 0; height: 44px; padding: 0 10px; box-sizing: border-box; border-radius: 3px; border: 1px solid #3b434e; background: #0a0d11; color: #fff; font: 15px -apple-system, system-ui, sans-serif; }
.so-acts { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.so-acts button { flex: 1; }
.so-loot { margin: 8px 0; padding: 6px; border: 1px solid #2c333d; border-radius: 2px; }
.so-h { font-size: 13px; color: #c3cbd6; margin-bottom: 4px; } .so-h b { color: var(--pal-set, #ffd24a); }
.so-seg { display: flex; gap: 6px; } .so-seg button { flex: 1; }
.so-note { font-size: 12px; color: #9aa4b2; line-height: 1.4; margin: 4px 2px; }
#pinvite { z-index: 30; }
#pinvite button { min-height: 44px; min-width: 96px; }
#pinvite em { font-style: normal; color: #c3cbd6; font-size: 12px; }

/* ---------- задания: «куда», авто-путь, история ---------- */
.q-where { font-size: 12px; color: #7fd4ff; margin-top: 2px; }
.qb-card .q-btns { gap: 6px; flex-wrap: wrap; }
.q-btns .q-go { color: #fff; border-color: #9fd0ff; background: linear-gradient(#2c5fae, #173a73 55%, #0f2650); }
.qb-hist { text-align: left; }
.q-histb { width: 100%; min-height: 44px; border: 0; background: none; color: #e8c26a; font: 700 13px -apple-system, system-ui, sans-serif; text-align: left; }
.qh-row { display: grid; grid-template-columns: 40px 1fr; column-gap: 6px; padding: 3px 0; border-top: 1px solid rgba(255,255,255,0.06); font-size: 12px; }
.qh-row em { grid-row: span 2; font-style: normal; color: #8a94a3; }
.qh-row span { color: #9aa4b2; font-size: 11.5px; }

/* ---------- умения: перетаскивание на слот, урон ---------- */
.sk-ghost { position: fixed; z-index: 70; width: 56px; height: 56px; border-radius: 50%; pointer-events: none; box-shadow: 0 0 14px rgba(255,210,120,0.8); }
#skills-win .sk-bslot.over { box-shadow: 0 0 0 3px #ffd27a, 0 0 14px rgba(255,210,120,0.8) !important; }
#skills-win .sk-dmg { color: #ffd24a; font-weight: 700; }
/* низкие альбомные экраны: варианты выбора — в 2 колонки, чтобы «Отмена» была видна без прокрутки */
@media (max-height: 340px) {
  .dlg-box { padding: 10px 10px 8px; width: min(560px, 100%); }
  .dlg-t { margin-bottom: 4px; }
  .dlg-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .dlg-opts button { padding: 4px 8px; }
  .dlg-btns { margin-top: 6px; }
}
/* Бюст героя (client/heroes/bust.js): голова и плечи в актуальном сете — группа, друзья, рейтинг */
img.bust { display: inline-block; flex: none; width: 36px; height: 36px; border-radius: 50%; vertical-align: middle; object-fit: cover;
  box-shadow: 0 0 0 1px #000, 0 0 0 2px #8a6a2c, 0 0 0 3px #000; background: #0b0a0e; }
.so-row img.so-ava { width: 40px; height: 40px; margin: 0 2px; }
.so-row.dead img.so-ava { filter: grayscale(1); }
#hud #party .pm img.bust { width: 26px; height: 26px; margin-right: 4px; }
.r-row .nm img.bust { width: 30px; height: 30px; margin-right: 6px; }
