:root {
  --chat-overlay-bg: rgba(5, 8, 15, 0.78);
  --chat-overlay-border: rgba(215, 227, 245, 0.22);
  --chat-text-strong: #f5f8ff;
  --chat-text-soft: rgba(232, 240, 255, 0.88);
  --chat-text-muted: rgba(206, 220, 242, 0.74);
}

#chat.panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#chat .video-stage-2028 {
  border: 1px solid rgba(170, 191, 220, 0.28);
  border-radius: 18px;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

#chat .video-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 56%, rgba(0, 0, 0, 0.52) 100%);
  z-index: 2;
}

#chat .video-chat-overlay {
  left: 12px;
  right: 12px;
  bottom: 12px;
  width: auto;
  max-width: none;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

#chat .panel-quick-controls,
#chat .settings-home-btn,
#chat #swipeUpHint {
  z-index: 40;
}

#chat .chat-status-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

#chat .chat-status-line {
  margin: 0;
  color: var(--chat-text-strong);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

#chat .chat-status-main {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

#chat .chat-status-private {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--chat-text-soft);
}

#chat .chat-transcript {
  margin: 6px 0 4px;
  padding: 0;
  max-height: 128px;
  overflow-y: auto;
  pointer-events: none;
}

#chat .chat-transcript-line {
  margin: 0 0 4px;
  line-height: 1.32;
  font-size: 0.92rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.58);
}

#chat .chat-transcript-line.you {
  color: var(--chat-text-strong);
  font-weight: 700;
}

#chat .chat-transcript-line.them {
  color: var(--chat-text-soft);
  font-weight: 600;
}

#chat .chat-transcript-line.system {
  color: var(--chat-text-muted);
}

#chat .chat-presence-row {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
}

#chat #typingHint,
#chat #typingStatus {
  font-size: 0.84rem;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.52);
}

#chat #typingHint {
  color: rgba(225, 236, 255, 0.92);
}

#chat #typingStatus {
  color: #ffe2aa;
}

#chat .video-chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--chat-overlay-border);
  border-radius: 999px;
  background: var(--chat-overlay-bg);
  pointer-events: auto;
}

#chat .chat-input-area {
  flex: 1;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #ffffff !important;
  min-height: 42px;
  max-height: 122px;
  line-height: 1.3;
  padding: 9px 14px 8px;
  font-size: 1rem;
}

#chat .chat-input-area::placeholder {
  color: rgba(233, 241, 255, 0.5);
}

#chat .chat-send-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #060a12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
}

#chat .chat-camera-btn {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(235, 244, 255, 0.34);
  border-radius: 999px;
  background: rgba(9, 15, 27, 0.94);
  color: #ecf4ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
}

#chat .chat-camera-btn.is-off {
  border-color: rgba(255, 122, 122, 0.7);
  background: rgba(84, 18, 18, 0.95);
  color: #ffdede;
}

#chat .chat-camera-btn:hover {
  filter: brightness(1.05);
}

#chat .chat-camera-btn:active {
  transform: translateY(1px);
}

#chat .chat-send-btn:hover {
  filter: brightness(0.95);
}

#chat .chat-send-btn:active {
  transform: translateY(1px);
}

@media (max-width: 768px) {
  #chat .video-stage-2028 {
    border-radius: 14px;
  }

  #chat .video-chat-overlay {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 6px;
  }

  #chat .chat-status-main {
    font-size: 0.9rem;
  }

  #chat .chat-status-private {
    font-size: 0.86rem;
  }

  #chat .chat-transcript {
    max-height: 112px;
    margin-top: 5px;
  }

  #chat .chat-transcript-line {
    margin-bottom: 3px;
    font-size: 0.86rem;
  }

  #chat #typingHint,
  #chat #typingStatus {
    font-size: 0.78rem;
  }

  #chat .chat-input-area {
    min-height: 40px;
    padding: 8px 12px 7px;
    font-size: 0.96rem;
  }

  #chat .chat-send-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  #chat .chat-camera-btn {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }
}
