* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background: #0f0f12;
  color: #efeff1;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  height: 50px;
  background: #18181b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #27272a;
}

/* Passcode Modal */
#auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-content {
  background: #1f1f23;
  padding: 30px;
  border-radius: 8px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-content input, .chat-footer input {
  padding: 10px;
  background: #0e0e10;
  border: 1px solid #3f3f46;
  border-radius: 4px;
  color: #fff;
}

.btn {
  padding: 10px;
  background: #9146ff;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

.btn:hover {
  background: #772ce8;
}

/* Main Layout */
#main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#video-wrapper {
  flex: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

video {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 50px);
  object-fit: contain;
}

/* Chat Panel */
#chat-panel {
  width: 340px;
  background: #18181b;
  border-left: 1px solid #27272a;
  display: flex;
  flex-direction: column;
}

.chat-header {
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-bottom: 1px solid #27272a;
  font-weight: 600;
  font-size: 14px;
}

.popout-btn {
  background: transparent;
  border: 1px solid #3f3f46;
  color: #adadb8;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.popout-btn:hover {
  background: #27272a;
  color: #fff;
}

#chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-entry {
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.chat-entry .time {
  color: #71717a;
  font-size: 11px;
  margin-right: 6px;
}

.chat-entry .author {
  font-weight: 700;
  color: #bf94ff;
  margin-right: 6px;
}

.system-entry {
  font-size: 12px;
  color: #a1a1aa;
  font-style: italic;
}

.chat-footer {
  padding: 10px 15px;
  border-top: 1px solid #27272a;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.name-row {
  display: flex;
  gap: 6px;
}

.name-row input {
  flex: 1;
  font-size: 12px;
  padding: 6px;
}

.name-row button {
  padding: 6px 10px;
  font-size: 12px;
}

.msg-row {
  display: flex;
  gap: 6px;
}

.msg-row input {
  flex: 1;
}