.chat-unread { display: inline-block; min-width: 17px; padding: 1px 4px; border-radius: 4px; background: #3d4d62; color: #d5dfec; font-size: 11px; line-height: 1.4; }
.chat-panel { position: fixed; top: 64px; right: 16px; bottom: 12px; width: 282px; display: flex; flex-direction: column; min-height: 0; background: #1b2027; border: 1px solid #465365; border-radius: 10px; padding: 12px; font-size: 12px; }
.chat-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.chat-heading h2 { font-size: 14px; margin: 0; }
.chat-heading p { color: var(--muted); font-size: 11px; margin: 5px 0 0; }
.chat-heading button { padding: 4px 8px; font-size: 12px; }
.chat-audience { color: var(--muted); font-size: 11px; padding-bottom: 10px; margin: 10px 0 0; border-bottom: 1px solid var(--line); }
.chat-messages { list-style: none; padding: 10px 2px; margin: 0; min-height: 80px; flex: 1; overflow: auto; overflow-anchor: none; scrollbar-width: thin; scrollbar-color: #46505f #1b2027; }
.chat-message { margin: 0 0 10px; padding: 8px; border: 1px solid #343d49; border-radius: 7px; background: #202630; }
.chat-message.own { background: #263140; border-color: #4b5d75; }
.chat-message-meta { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 11px; color: #aebdd0; }
.chat-message-meta strong { font-weight: 600; overflow-wrap: anywhere; }
.chat-message-meta time { white-space: nowrap; color: var(--muted); font-size: 10px; }
.chat-message p { margin: 5px 0 0; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-empty { padding: 20px 4px; text-align: center; color: var(--muted); font-size: 12px; }
.chat-latest { padding: 5px 8px; font-size: 11px; background: #29384a; margin-bottom: 8px; }
.chat-form { flex-shrink: 0; border-top: 1px solid var(--line); padding-top: 10px; }
.chat-form textarea { display: block; width: 100%; min-height: 60px; max-height: 140px; resize: vertical; border: 1px solid #47576d; border-radius: 6px; background: #151b23; color: var(--text); font: inherit; line-height: 1.6; padding: 8px; }
.chat-form textarea:focus-visible { outline: 2px solid #8097b4; outline-offset: 1px; }
.chat-form textarea[aria-invalid=true] { border-color: #ba8d83; }
.chat-compose-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.chat-compose-footer > span { font-size: 10px; line-height: 1.5; color: var(--muted); }
.chat-compose-footer button { padding: 6px 10px; font-size: 12px; }
@media(min-width: 1100px) {
  .chat-open #app { width: calc(100% - 310px); margin-left: 0; margin-right: 310px; }
  .chat-open:not(.in-game) .chat-panel { top: 96px; }
}
@media(min-width: 1100px) and (max-width: 1399px) { .chat-open .players { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media(max-width: 1099px) {
  .chat-panel { position: static; width: auto; height: 360px; margin: 10px; }
  .chat-open.in-game { height: auto; overflow: auto; }
  .chat-open.in-game #app { height: auto; display: block; overflow: visible; }
  .chat-open .game { display: block; }
  .chat-open .game > * + * { margin-top: 8px; }
  .chat-open .game .play-layout { display: flex; height: clamp(260px,40vh,380px); }
  .chat-open .table-wrap { display: flex; flex-direction: column; flex: 1; min-width: 0; }
  .chat-open .table-bar { flex-shrink: 0; }
  .chat-open .board { flex: 1; min-height: 0; height: auto; }
  .chat-open .turn-actions { position: static; }
  .chat-open .game.is-finished { overflow: visible; }
}
