@use "_variables" as *;

.live-page {
  margin: 15px;
  padding: 1.5rem;
  min-height: 100vh;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
}

.live-page.centered {
  margin: 0 auto;
}

.live-header {
  margin-bottom: 1rem;

  h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
  }

  p {
    margin-top: 6px;
    color: #aaaaaa;
    font-size: 14px;
  }
}

.live-content {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 1rem;
  align-items: start;
}

.player-column {
  min-width: 0;
}

.player-shell {
  border: 1px solid var(--bg-secondary-450);
  border-radius: 10px;
  overflow: hidden;
  background: black;
  margin-bottom: 20px;

  video {
    width: 100%;
    min-height: min(72vh, 760px);
    background: black;
    border: 0;
  }
}

.chat-panel {
  border: 1px solid var(--bg-secondary-450);
  border-radius: 10px;
  background: #121212;
  min-height: 72vh;
  height: 72vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);

  h2 {
    margin: 0;
    font-size: 1.1rem;
  }

  p {
    margin: 0.25rem 0 0;
    color: #9f9f9f;
    font-size: 0.875rem;
  }
}

.chat-identity {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: white;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}

.chat-messages {
  padding: 1rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}

.chat-empty {
  color: #9f9f9f;
}

.chat-message {
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--bg-secondary-300);
  p {
    margin: 0.35rem 0 0;
    color: #f2f2f2;
    white-space: pre-wrap;
    word-break: break-word;
  }
}

.chat-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;

  span {
    color: #9f9f9f;
  }
}

.chat-compose {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;

  input {
    min-width: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-secondary-300);
    color: white;
    padding: 0.8rem 0.9rem;
  }

  button {
    border: 0;
    border-radius: 8px;
    padding: 0 1rem;
    background: var(--mainColor);
    color: white;
    font-weight: 600;
  }
}

.chat-emoji-toggle {
  min-width: 46px;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
}

.chat-emoji-picker {
  position: absolute;
  right: calc(1rem + 70px);
  bottom: calc(100% + 0.75rem);
  width: min(280px, calc(100vw - 4rem));
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #1a1a1a;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
  z-index: 2;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

.chat-emoji-picker-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chat-emoji-option {
  min-height: 40px;
  padding: 0 !important;
  // background: var(--bg-secondary-300) !important;
  font-size: 1.3rem;
  line-height: 1;
}

.chat-error {
  color: #ff7a7a;
  padding: 0 1rem 1rem;
}

.chat-hint {
  color: #9f9f9f;
  padding: 0 1rem 1rem;
  font-size: 0.9rem;
}

.username-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.username-modal {
  width: min(420px, 100%);
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 1.25rem;

  h2 {
    margin: 0 0 0.5rem;
  }

  p {
    margin: 0 0 1rem;
    color: #9f9f9f;
  }

  input {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-secondary-100);
    color: white;
    padding: 0.85rem 0.9rem;
  }
}

.username-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;

  button {
    border: 0;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    background: var(--mainColor);
    color: white;
    font-weight: 600;
  }

  .secondary {
    background: #2b2b2b;
  }
}

.error {
  margin-top: 20px;
  color: #ff4d4f;
  font-weight: 500;
}

.hint {
  margin-top: 20px;
  font-size: 18px;
  font-weight: 500;
  word-break: break-all;
}

.brokerDetails {
  margin-top: 20px !important;
}

@media screen and (max-width: 900px) {
  .player-shell video {
    min-height: 58vh;
  }

  .live-content {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    min-height: 420px;
    height: 420px;
  }

  .chat-compose {
    grid-template-columns: 1fr auto;
  }

  .chat-compose input {
    grid-column: 1 / -1;
  }

  .chat-emoji-picker {
    right: 1rem;
    left: 1rem;
    width: auto;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
