/* ==========================================================================
   Masa sohbeti (Okey ve Poker): küçük kutu, son mesajlar, kaydırılabilir hazır mesaj çipleri, kısa yazı alanı.
   Okey: ıstakanın sağındaki boş alan (konum ve yükseklik css/rack.css içindeki --rw, --rowh'dan türer), 1000px altında gizli.
   Poker: masanın solunda yer varsa orada (.side), yoksa sahnenin sağ alt köşesinde yüzer (app.js fitPokerChat);
   yüzen kutu "Sohbet" düğmesi olarak kapalı başlar, dokununca açılır. Poker sohbeti her ekran genişliğinde görünür.
   ========================================================================== */
.chat-box { display: none; }

/* ortak görünüm */
.chat-box {
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid rgba(201, 162, 74, .55);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(14, 52, 84, .94), rgba(6, 26, 44, .97));
  box-shadow: inset 0 0 0 1px rgba(251, 231, 163, .1), 0 3px 8px rgba(0, 0, 0, .4);
  color: #e6eef3;
  font: 600 12px/1.3 "Segoe UI", system-ui, sans-serif;
}

.chat-log {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 74, .5) transparent;
}
.chat-line { overflow-wrap: anywhere; }
.chat-from { margin-right: 5px; font-weight: 800; color: #ffd76a; }
.chat-line[data-seat="1"] .chat-from { color: #7fd1ff; }
.chat-line[data-seat="2"] .chat-from { color: #ff9c9c; }
.chat-line[data-seat="3"] .chat-from { color: #9be7a8; }
.chat-line.mine .chat-text { color: #fff; }
.chat-line.sys { color: #9fb4c2; font-weight: 500; font-style: italic; }

.chat-quick {
  flex: none;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-quick::-webkit-scrollbar { display: none; }
.chat-chip {
  flex: none;
  padding: 2px 8px;
  border: 1px solid rgba(201, 162, 74, .5);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: #f1e6c4;
  font: 700 11px/1.5 "Segoe UI", system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
.chat-chip:hover { background: rgba(251, 231, 163, .2); color: #fff; }
.chat-chip:active { transform: translateY(1px); }
.chat-chip:disabled { opacity: .5; cursor: default; }

.chat-form { flex: none; display: flex; gap: 4px; }
.chat-form input {
  flex: 1 1 auto;
  min-width: 0;
  height: 24px;
  box-sizing: border-box;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  background: rgba(0, 0, 0, .28);
  color: #fff;
  font: 600 12px "Segoe UI", system-ui, sans-serif;
}
.chat-form input::placeholder { color: rgba(230, 238, 243, .5); }
.chat-form input:focus-visible { outline: 2px solid #e0b24e; outline-offset: 0; }
.chat-send {
  flex: none;
  width: 28px;
  height: 24px;
  padding: 0;
  border: 1px solid #a98a3a;
  border-radius: 6px;
  background: linear-gradient(180deg, #f0c75e, #b9831f);
  color: #3a2706;
  font-size: 12px;
  cursor: pointer;
}
.chat-send:hover { filter: brightness(1.1); }
.chat-send:disabled { opacity: .5; cursor: default; filter: none; }

.chat-toggle {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9fb4c2;
  font: 800 14px/14px "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}
.chat-toggle:hover { color: #fff; }

/* ---- Okey: ıstakanın sağındaki boşluk (yalnızca geniş ekran) ---- */
@media (min-width: 1000px) {
  body #okeyView .chat-box {
    display: flex;
    position: absolute;
    z-index: 3;
    top: 0;
    left: calc(50% + var(--rw) / 2 + 94px);
    width: clamp(150px, calc(50% - var(--rw) / 2 - 106px), 300px);
    height: calc(var(--rowh) * 2 + var(--groove) + var(--lip));
  }
}
@media (min-width: 1000px) and (max-width: 1100px) {
  body #okeyView .chat-box { left: calc(50% + var(--rw) / 2 + 86px); width: clamp(150px, calc(50% - var(--rw) / 2 - 98px), 300px); }
}

/* ---- Poker: sahnenin içinde. Varsayılan yüzen kutu sağ alt köşede (çanak göstergesinin karşısında);
        masanın solunda yer varsa .side ile oraya asılır ---- */
body #pokerView .chat-box {
  display: flex;
  position: absolute;
  z-index: 6;
  right: 1.6%;
  bottom: 2.4%;
  width: min(236px, 62%);
  height: 132px;
}
body #pokerView .chat-box.side {
  right: calc(100% + 14px);
  bottom: 0;
  width: 232px;
  height: 136px;
}

/* gizli: yalnızca küçük "Sohbet" düğmesi kalır; yeni mesajda altın nokta yanar */
body #okeyView .chat-box.collapsed,
body #pokerView .chat-box.collapsed {
  width: max-content;
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.chat-box.collapsed > :not(.chat-toggle) { display: none; }
.chat-box.collapsed .chat-toggle {
  position: static;
  width: auto;
  height: auto;
  padding: 4px 12px;
  border: 1px solid rgba(201, 162, 74, .55);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(14, 52, 84, .95), rgba(6, 26, 44, .95));
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
  color: #f1e6c4;
  font: 700 12px/1.3 "Segoe UI", system-ui, sans-serif;
}
.chat-box.collapsed.unread .chat-toggle::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: #ffd76a;
  box-shadow: 0 0 6px #ffd76a;
}
