* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Elms Sans", sans-serif;
  font-weight: 600;
  height: 100vh;
  background: #0f0f12;
  color: #eee;
}

header {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  padding: 0 16px;
}

header form {
  display: flex;
  gap: 8px;
  width: min(100%, 720px);
}

header input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #1a1a22;
  color: #eee;
}

button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: #e62117;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

main {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  padding: 0 16px 24px;
  overflow: visible;
}
.video {
  flex: 1;
  min-width: 320px;
  max-width: 1800px;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.video iframe {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  border: none;
}

.all-chat {
  flex: 1;
  min-width: 320px;
  max-width: 400px;
  height: calc(100vh - 120px);
  min-height: 450px;
  max-height: 675px;
  display: flex;
  flex-direction: column;
  background: #1a1a22;
  border-radius: 12px;
  border: 1px solid #333;
  overflow: visible;
}

#spisok {
  flex: 1;
  list-style: none;
  overflow-y: auto;
  padding: 16px;
}

#spisok li {
  margin-bottom: 10px;
  line-height: 1.4;
  word-break: break-word;
}

.msg-user {
  color: #9cdcfe;
}

.msg-ai {
  color: #c5e1a5;
}

.chat-form-wrap {
  padding: 10px;
  border-top: 1px solid #333;
}

.chats {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chats input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0f0f12;
  color: #eee;
  font-family: inherit;
}

.chat-cooldown {
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.8;
}

#inpes {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
  background: #0f0f12;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-right: 4px;
}
#inpes::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 135%;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: #1a1a22;
  color: #eee;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #444;
  font-family: inherit;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  z-index: 99;
}

#inpes:hover {
  border-color: #555;
  background: #16161e;
}

#inpes:checked {
  background: #e62117;
  border-color: #e62117;
}

#inpes:checked::before {
  content: "";
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}
#inpes:hover::after,
#inpes:hover::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
@media (max-width: 900px) {
  main {
    flex-direction: column;
    align-items: center;
  }

  .video {
    max-width: 100%;
  }

  .all-chat {
    width: 100%;
    max-height: 500px;
  }
}
