* {
  box-sizing: border-box;
}

:root {
  --clc-bg: #0b0f17;
  --clc-surface: #0f141f;
  --clc-surface-2: #121a27;
  --clc-border: #1b2638;
  --clc-accent: #3aa0ff;
  --clc-accent-strong: #1c7ed6;
  --clc-text: #eef2f7;
  --clc-muted: #a9b4c6;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--clc-bg);
  color: var(--clc-text);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--clc-surface);
  border-bottom: 1px solid var(--clc-border);
}

.brand__name {
  font-weight: 700;
  font-size: 1.1rem;
  display: block;
}

.brand__tag {
  color: var(--clc-accent);
  font-size: 0.9rem;
}

.header__actions {
  display: flex;
  gap: 8px;
}

.content {
  display: grid;
  grid-template-columns: minmax(0, 2.8fr) minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  flex: 1;
}

.video__player {
  position: relative;
  background: #0a0a0a;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.video__player video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video__status {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.video__info {
  margin-top: 12px;
  color: var(--clc-muted);
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--clc-surface);
  border-radius: 12px;
  padding: 16px;
  height: 100%;
  position: relative;
}

.chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat__messages {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.emoji-picker {
  position: absolute;
  bottom: 72px;
  right: 16px;
  background: var(--clc-surface-2);
  border: 1px solid var(--clc-border);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  max-width: 100%;
}

.emoji-picker button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
}

.chat__form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.chat__form input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--clc-border);
  background: #0a0f18;
  color: var(--clc-text);
}

.chat__form button {
  white-space: nowrap;
}

.btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: var(--clc-accent);
  color: #fff;
  cursor: pointer;
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--clc-border);
  color: var(--clc-muted);
}

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
}

.toast {
  background: var(--clc-surface-2);
  border: 1px solid var(--clc-border);
  color: var(--clc-text);
  padding: 10px 14px;
  border-radius: 10px;
  min-width: 220px;
  max-width: 320px;
  font-size: 0.9rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.toast--error {
  border-color: #f87171;
  color: #fecaca;
}

.toast--success {
  border-color: #34d399;
  color: #bbf7d0;
}

.chat__message {
  display: flex;
  gap: 10px;
  background: var(--clc-surface-2);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.92rem;
}

.chat__message strong {
  color: var(--clc-text);
}

.chat__meta {
  font-size: 0.7rem;
  color: var(--clc-muted);
  margin-left: 8px;
}

.chat__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #101219;
  flex-shrink: 0;
}

.chat__bubble {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat__header-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.chat__text {
  color: var(--clc-text);
}

.admin {
  border-top: 1px solid var(--clc-border);
  padding-top: 12px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin__row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin__users {
  flex-direction: column;
  align-items: stretch;
}

.admin__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.admin__list--empty {
  color: var(--clc-muted);
  font-size: 0.85rem;
}

.admin__user {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: #0a0f18;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.admin__user button {
  font-size: 0.75rem;
  padding: 4px 8px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal__card {
  background: var(--clc-surface);
  padding: 24px;
  border-radius: 12px;
  width: min(380px, 90%);
}

.modal__card input {
  width: 100%;
  margin: 10px 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--clc-border);
  background: #0a0f18;
  color: var(--clc-text);
}

.modal__error {
  color: #fca5a5;
  margin: 8px 0 0;
  font-size: 0.9rem;
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .content {
    grid-template-columns: 1fr;
  }

  .video__player {
    aspect-ratio: 16 / 10;
  }

  .chat {
    min-height: 340px;
  }
}

@media (max-width: 600px) {
  .chat__form {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .chat__form input {
    grid-column: 1 / -1;
  }

  #emojiToggle {
    grid-column: 1 / 2;
  }

  .chat__form button[type="submit"] {
    grid-column: 2 / 3;
  }

  .emoji-picker {
    bottom: 110px;
    right: 10px;
  }
}
