/* --- Chat / Video call page --- */
.page-chat {
  flex-direction: column;
  height: 100%;
}

/* --- Top bar --- */
.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--glass-strong);
  border-bottom: 1px solid var(--stroke);
  z-index: 10;
  flex-shrink: 0;
}
.chat-topbar-left {
  display: flex; align-items: center; gap: 12px;
}
.chat-topbar-logo {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--pink), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.chat-topbar-right {
  display: flex; align-items: center; gap: 8px;
}

/* --- Video area --- */
.video-area {
  flex: 1;
  display: flex;
  gap: 4px;
  padding: 4px;
  min-height: 0;
  position: relative;
}

.video-tile {
  flex: 1;
  position: relative;
  background: #111;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.video-tile > video {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute; inset: 0;
  z-index: 2;
}
.video-tile .idle-noise {
  position: absolute; inset: 0;
  z-index: 1;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .85rem;
}
.video-tile .idle-noise video {
  position: absolute; inset: 0;
  opacity: .3;
}

.video-tile-local {
  position: relative;
}
.video-tile-local video { transform: scaleX(-1); }

/* --- Overlay (searching/connecting) --- */
.video-overlay {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.55);
  z-index: 3;
  border-radius: var(--radius-sm);
}
.video-overlay.show { display: flex; }
.video-overlay-content {
  text-align: center;
  color: #fff;
}
.video-overlay .dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.video-overlay .dot {
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
  animation: dot-bounce 1.4s ease infinite;
}
.video-overlay .dot:nth-child(2) { animation-delay: .2s; }
.video-overlay .dot:nth-child(3) { animation-delay: .4s; }
@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* --- Controls bar --- */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--glass-strong);
  border-top: 1px solid var(--stroke);
  flex-shrink: 0;
  z-index: 10;
}

/* --- Text chat panel --- */
.text-chat {
  display: none;
  flex-direction: column;
  width: 300px;
  border-left: 1px solid var(--stroke);
  background: var(--glass-strong);
  flex-shrink: 0;
}
.text-chat.open { display: flex; }

.text-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-msg {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  max-width: 85%;
  word-break: break-word;
}
.chat-msg.mine {
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.chat-msg.theirs {
  background: rgba(255,255,255,.08);
  color: var(--txt);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}
.chat-msg .name { font-size: .75rem; color: var(--muted); margin-bottom: 2px; }

.text-chat-input {
  display: flex; gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--stroke);
}
.text-chat-input input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-sm);
  color: var(--txt);
  font-size: .85rem;
  outline: none;
}
.text-chat-input input:focus { border-color: var(--pink); }
.text-chat-input button {
  padding: 10px 16px;
  background: var(--pink);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 600;
  font-size: .85rem;
}

/* --- Peer label --- */
.peer-label {
  position: absolute;
  bottom: 12px; left: 12px;
  padding: 4px 12px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  z-index: 5;
  backdrop-filter: blur(4px);
}

/* --- Admin kick btn --- */
.admin-kick-btn {
  position: absolute;
  top: 52px; right: 10px;
  z-index: 20;
  background: rgba(239,68,68,.85);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  display: none;
}
.admin-kick-btn:hover { background: rgba(220,38,38,.95); }
