/* Tchat. (chargé après 07-lobby-tabs.css, l'ordre compte pour la cascade) */

/* ---------- Tchat ---------- */
.list-item .badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font:
    700 0.66rem/18px Barlow,
    sans-serif;
  text-align: center;
}
.list-item .badge {
  margin-left: auto;
  align-self: center;
  flex-shrink: 0;
}
.chat-card {
  height: 640px;
  max-width: 480px;
  overflow: hidden;
  padding: 14px 16px;
}
.chat-card,
.chat-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* onglet Tchat : la page occupe tout le panneau, seuls les messages défilent */
/* le bouton d'action du centre dépasse de 16 px au-dessus de la barre d'onglets : la saisie reste au-dessus */
#sheetContent.has-chat {
  overflow: hidden;
  padding-bottom: 28px;
}
.chat-page {
  flex: 1 1 auto;
  min-height: 0;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.chat-head .page-title {
  margin: 10px 0 2px;
}
.chat-head .chat-back {
  margin-left: -8px;
}
.chat-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-card .chat-title {
  margin: 0;
  font: 800 1.35rem var(--cond);
  text-transform: uppercase;
}
.chat-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.chat-foot {
  flex-shrink: 0;
}
.chat-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-foot > .btn {
  width: 100%;
  justify-content: center;
}
.chat-foot .msg-row .btn {
  padding-left: 14px;
  padding-right: 14px;
}
.chat-quick {
  padding: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-quick::-webkit-scrollbar {
  display: none;
}
.chat-quick .power-chip {
  flex-shrink: 0;
  background: var(--bg);
}
.chat-help {
  margin: 4px 0 8px;
  font-size: 0.88rem;
}
.chat-conv .li-text,
.chat-pick .li-text {
  min-width: 0;
  flex: 1;
}
.chat-conv .li-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-pick {
  cursor: pointer;
}
.chat-pick input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.chat-msgs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px;
}
.chat-msg {
  align-self: flex-start;
  max-width: 82%;
  padding: 7px 11px 5px;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.chat-msg.me {
  align-self: flex-end;
  border-radius: var(--radius);
  background: var(--accent-50);
}
.chat-msg.quick .chat-text {
  font-weight: 700;
}
.chat-author {
  font: 700 0.74rem var(--cond);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.chat-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.chat-time {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: right;
  margin-top: 1px;
}
.chat-error {
  margin: 0;
  color: var(--danger-text);
  font-size: 0.85rem;
}
.chat-ro {
  color: var(--muted);
  font-size: 0.8rem;
}
/* médias du tchat : photos, GIF, vidéos, messages vocaux */
.chat-form .chat-attach {
  flex-shrink: 0;
  margin: 0 -2px 0 -6px;
}
.chat-attach-menu {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-attach-menu.hidden {
  display: none;
}
.chat-attach-menu .power-chip {
  flex-shrink: 0;
  background: var(--bg);
}
.chat-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}
.chat-upload.hidden {
  display: none;
}
.chat-upload-label {
  flex-shrink: 0;
}
.chat-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
}
.chat-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s;
}
.chat-rec {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.chat-rec.hidden {
  display: none;
}
.chat-rec .btn {
  margin-left: auto;
  padding-left: 14px;
  padding-right: 14px;
}
.chat-rec .rec-time {
  font: 700 1.05rem var(--cond);
  font-variant-numeric: tabular-nums;
}
.chat-rec .rec-hint {
  color: var(--muted);
  font-size: 0.88rem;
}
.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: rec-blink 1s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes rec-blink {
  50% {
    opacity: 0.25;
  }
}
.chat-msg.has-media {
  padding: 4px 4px 4px;
}
.chat-msg.has-media .chat-author,
.chat-msg.has-media .chat-text,
.chat-msg.has-media .chat-time {
  padding: 0 7px;
}
.chat-msg.has-media .chat-author {
  padding-top: 3px;
}
.chat-msg.media-audio {
  padding: 7px 11px 5px;
}
.chat-msg.media-audio .chat-author,
.chat-msg.media-audio .chat-text,
.chat-msg.media-audio .chat-time {
  padding: 0;
}
.chat-img,
.chat-video {
  display: block;
  width: 240px;
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}
.chat-img {
  padding: 0;
  border: 0;
  cursor: zoom-in;
}
.chat-img img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
}
.chat-video {
  object-fit: contain;
  background: #000;
}
.chat-msg.has-media .chat-img + .chat-text,
.chat-msg.has-media .chat-video + .chat-text {
  margin-top: 4px;
}
.chat-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  padding: 2px 0;
}
.chat-play {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.chat-play .ic {
  width: 18px;
  height: 18px;
}
.chat-wave {
  flex: 1;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}
.chat-wave::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.18;
}
.chat-wave i {
  position: relative;
  height: 4px;
  width: 0;
  border-radius: 2px;
  background: var(--accent);
}
.chat-adur {
  font: 600 0.82rem var(--cond);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 32px;
  text-align: right;
}
.chat-viewer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  place-items: center;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.chat-viewer.hidden {
  display: none;
}
.chat-viewer img {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}
.chat-viewer .icon-btn {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
}
