/* SOHBET PENCERESİ (2026-12-01) — sağ sütundaki Sohbet düğmesi ya da Enter açar (app.js › Sohbet). Sürüklenebilir; varsayılan yeri
   orta alanın sağ alt köşesi (sağ sütunun hemen solu). Kayıt biçimi: saat · arma · ad (kavim) / metin; aynı kişinin art arda yazdıkları tek
   başlıkta; gün ayracı; "Yeni mesajlar" çizgisi; Dünya / Kavim sekmelerinde okunmamış sayısı; adını anan mesaj altınla; @ad vurgusu.
   Oyunun dili: koyu zemin, ince altın kontur, serif başlık; kavim kanalında vurgu rengi kavmin rengi. */
.app.desk > .chat {
  --t1: #f0e8d8; --t2: #cfc7bc; --mu: #8f867d; --mu2: #6a625a; --ln: #2a2520; --gd: #e2be68; --ac: var(--gd);
  position: fixed; left: auto; right: auto; bottom: auto; top: 80px; z-index: 88;   /* pencerelerin (60) üstünde, envanterin (90) altında */
  width: 440px; height: min(540px, calc(100vh - 32px)); border-radius: 14px;
  background: repeating-linear-gradient(135deg, rgba(255, 236, 200, .016) 0 1px, transparent 1px 9px), linear-gradient(180deg, #1b1816, #131110 70%, #110f0e);
  box-shadow: 0 0 0 1px #3a3226, inset 0 1px 0 rgba(255, 240, 210, .05), 0 22px 50px -14px rgba(0, 0, 0, .95);
  clip-path: none; opacity: 0; transform: translateY(10px) scale(.985); transform-origin: 100% 100%;
  transition: opacity .2s, transform .28s cubic-bezier(.22, .9, .3, 1);
}
.app.desk > .chat.on { opacity: 1; transform: none; pointer-events: auto; }
.app.desk > .chat.drag { transition: none; box-shadow: 0 0 0 1px #6d5a35, 0 28px 60px -12px #000; }
.app.desk > .chat.fac { --ac: var(--fc); }
.app.desk > .chat .ic { flex: none; stroke-width: 1.6; }
.app.desk > .chat .num { font-family: var(--fn, Inter, sans-serif); font-variant-numeric: tabular-nums; }
.app.desk > .chat .ch-in::after { content: none; }

/* başlık: sürükleme tutamağı */
.ch-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 11px 12px 10px 14px; border-bottom: 1px solid var(--ln); cursor: grab; user-select: none; }
.chat.drag .ch-head { cursor: grabbing; }
.ch-seal { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--ac); background: #171412; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac) 45%, transparent); transition: color .25s, box-shadow .25s; }
.ch-seal .ic { width: 16px; height: 16px; }
.ch-ttl { display: grid; gap: 4px; min-width: 0; flex: 1; }
.ch-ttl b { font: 700 15px/1 var(--fs); letter-spacing: .04em; color: var(--t1); }
.ch-ttl small { font: 500 10.5px/1.1 var(--fb); color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-live { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.ch-live i { width: 6px; height: 6px; border-radius: 50%; background: #6fc47f; box-shadow: 0 0 5px rgba(111, 196, 127, .7); }
.ch-live small { font: 500 10px/1 var(--fb); color: var(--mu); }
.ch-live.bad i { background: #d9735a; box-shadow: 0 0 5px rgba(217, 115, 90, .7); }
.ch-x { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; font: 400 18px/1 var(--fb); color: var(--mu); transition: color .15s, background .15s; }
.ch-x:hover { color: var(--t1); background: rgba(255, 240, 210, .06); }

/* sekmeler */
.app.desk > .chat .ch-top { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--ln); }
.app.desk > .chat .ch-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: #100e0d; box-shadow: inset 0 0 0 1px #24201c; }
.app.desk > .chat .ch-tabs button { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 7px; font: 600 11.5px/1 var(--fb); letter-spacing: .01em; color: var(--mu); }
.app.desk > .chat .ch-tabs button .ic, .ch-temb .ic { width: 13px; height: 13px; }
.ch-temb { display: inline-grid; color: var(--fc); }
.app.desk > .chat .ch-tabs button:hover { color: var(--t2); }
.app.desk > .chat .ch-tabs button.on { color: var(--gd); background: rgba(226, 190, 104, .1); box-shadow: inset 0 0 0 1px rgba(226, 190, 104, .38); }
.app.desk > .chat .ch-tabs button[data-ch="fac"].on { color: var(--fc); background: color-mix(in srgb, var(--fc) 11%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fc) 42%, transparent); }
.ch-tabs button b { min-width: 0; font: 700 9px/1 var(--fn, Inter, sans-serif); }
.ch-tabs button b:empty { display: none; }
.ch-tabs button.has b { padding: 2px 5px; border-radius: 6px; color: #1a140c; background: #cfc7bc; }
.ch-keys { margin-left: auto; font: 500 10px/1 var(--fb); color: var(--mu2); white-space: nowrap; }
.ch-keys kbd { display: inline-grid; place-items: center; height: 16px; padding: 0 4px; margin: 0 1px; border-radius: 4px; font: 700 8.5px/1 var(--fn); color: #a89f94; background: #121010; box-shadow: inset 0 0 0 1px #3a3328; }

/* mesaj listesi */
.ch-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.app.desk > .chat .ch-list { flex: 1; padding: 8px 12px 8px 10px; gap: 0; scrollbar-width: thin; scrollbar-color: #3a332b transparent; -webkit-mask: linear-gradient(180deg, transparent, #000 12px); mask: linear-gradient(180deg, transparent, #000 12px); }
.app.desk > .chat .ch-list::-webkit-scrollbar { display: block; width: 6px; }
.app.desk > .chat .ch-list::-webkit-scrollbar-thumb { background: #3a332b; border-radius: 3px; }
.app.desk > .chat .cm { display: grid; grid-template-columns: 34px 18px minmax(0, 1fr); column-gap: 8px; align-items: start; max-width: none; padding: 7px 6px 2px; margin: 0; border-radius: 6px; }
.app.desk > .chat .cm.cont { padding-top: 1px; margin-top: 0; }
.app.desk > .chat .cm.me { align-self: stretch; flex-direction: initial; }
.app.desk > .chat .cm.new { animation: chIn .35s ease-out both; }
@keyframes chIn { from { opacity: 0; transform: translateY(5px); } }
.cm time { padding-top: 2px; font-size: 10px; color: var(--mu2); text-align: right; }
.app.desk > .chat .cm-e { width: 18px; height: 18px; margin-top: 0; font-size: 11px; border-radius: 50%; color: var(--mc); background: color-mix(in srgb, var(--mc) 10%, #151312); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mc) 32%, transparent); }
.app.desk > .chat .cm.cont .cm-e { background: none; box-shadow: none; height: 0; }
.cm-t { min-width: 0; display: grid; gap: 2px; }
.app.desk > .chat .cm-h { display: flex; align-items: baseline; gap: 7px; margin: 0; justify-content: flex-start; }
.app.desk > .chat .cm-h b, .cm-n { font: 700 12px/1.2 var(--fs); letter-spacing: .02em; color: var(--mc); }
.app.desk > .chat .cm.me .cm-h b { color: var(--gd); }
.cm-n { padding: 0; cursor: pointer; text-align: left; }
.cm-n:hover { text-decoration: underline; text-underline-offset: 2px; }
.app.desk > .chat .cm-h small { font: 500 9.5px/1 var(--fb); color: var(--mu2); }
.app.desk > .chat .cm-t p { margin: 0; font: 400 13px/1.42 var(--fb); color: var(--t2); overflow-wrap: anywhere; }
.app.desk > .chat .cm.me .cm-t p { color: var(--t1); }
.cm-t p em { font-style: normal; font-weight: 600; color: var(--gd); }
.app.desk > .chat .cm.me { box-shadow: inset 2px 0 0 rgba(226, 190, 104, .35); }
.app.desk > .chat .cm.at { background: rgba(226, 190, 104, .07); box-shadow: inset 2px 0 0 var(--gd); }
.ch-day, .ch-newl { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; font: 600 9.5px/1 var(--fb); letter-spacing: .1em; text-transform: uppercase; color: var(--mu2); }
.ch-day::before, .ch-day::after, .ch-newl::before, .ch-newl::after { content: ''; flex: 1; height: 1px; background: var(--ln); }
.ch-newl { color: var(--gd); }
.ch-newl::before, .ch-newl::after { background: rgba(226, 190, 104, .35); }
.app.desk > .chat .ch-empty .ic { width: 28px; height: 28px; color: #5f564c; }
.ch-down { position: absolute; left: 50%; bottom: 8px; translate: -50% 0; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: 13px;
  font: 600 11px/1 var(--fb); color: #1a140c; background: linear-gradient(180deg, #d1b26a, #a7874b); box-shadow: 0 6px 14px -6px #000; }
.ch-down .ic { width: 10px; height: 10px; fill: currentColor; stroke: none; }
.ch-down[hidden] { display: none; }

/* yazı kutusu */
.app.desk > .chat .ch-in { align-items: center; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--ln); background: #100e0d; }
.ch-chip { flex: none; padding: 5px 8px; border-radius: 6px; font: 700 10px/1 var(--fb); letter-spacing: .04em; color: var(--ac); background: color-mix(in srgb, var(--ac) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac) 35%, transparent); }
.app.desk > .chat .ch-in input { height: 34px; padding: 0 10px; border-radius: 8px; font-size: 13px; background: #181513; box-shadow: inset 0 0 0 1px #2f2a25; }
.app.desk > .chat .ch-in input:focus { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac) 55%, transparent); }
.ch-cnt { flex: none; min-width: 40px; text-align: right; font-size: 10px; color: var(--mu2); }
.ch-cnt.hi { color: #e0a060; }
.app.desk > .chat .ch-send { width: 34px; height: 34px; border-radius: 8px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 0 #0b0a0a; }
.app.desk > .chat .ch-send .ic { width: 15px; height: 15px; }
@media (prefers-reduced-motion: reduce) { .app.desk > .chat, .app.desk > .chat .cm.new { transition: opacity .15s; animation: none; transform: none; } }
/* geniş ekranda (1920 × 1080) biraz büyür */
@media (min-width: 1600px) and (min-height: 900px) { .app.desk > .chat { width: 500px; height: min(640px, calc(100vh - 32px)); } }
