/* 기본 스타일 */
body, html {
  margin: 0; padding: 0;
  height: 100vh;
  background-color: #121212;
  color: #e0e0e0;
  font-family: 'Noto Sans KR', Arial, sans-serif;
  display: flex;
  overflow: hidden;
  flex-direction: column;
}

#init-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
  background-color: #121212;
  padding: 20px;
}

#init-screen input[type="text"] {
  width: 300px;
  padding: 12px;
  font-size: 18px;
  border-radius: 6px;
  border: none;
  outline: none;
  background-color: #1e1e1e;
  color: #e0e0e0;
  box-shadow: 0 0 5px #333;
}

#init-screen button {
  padding: 12px 20px;
  font-size: 18px;
  border-radius: 6px;
  border: none;
  background-color: #4caf50;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#init-screen button:hover {
  background-color: #388e3c;
}

#channel-list {
  padding: 12px;
  background: #121212;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

#channel-list button {
  background-color: #2e2e2e;
  color: #a5d6a7;
  font-weight: 700;
  font-size: 1.6rem;
  width: 125px;
  height: 100px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

#channel-list button:hover,
#channel-list button.active {
  background-color: #4caf50;
  color: #fff;
}

#app-container {
  display: flex;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

#player-container {
  flex: 9;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: black;
  border-radius: 8px;
  box-shadow: 0 0 20px #4caf50aa;
}

#chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-left: 2px solid #121212;
  background-color: #1e1e1e;
}

#chat-header {
  padding: 12px;
  font-weight: bold;
  font-size: 1.2rem;
  background-color: #121212;
  text-align: center;
  user-select: none;
}

#chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.3;
  word-break: break-word;
  min-height: 0;
}

#chat-messages::-webkit-scrollbar {
  width: 6px;
}

#chat-messages::-webkit-scrollbar-thumb {
  background-color: #121212;
  border-radius: 3px;
}

.chat-message {
  margin-bottom: 8px;
}

#chat-input-area {
  display: flex;
  padding: 10px;
  background-color: #121212;
}

#chat-input {
  flex: 1;
  padding: 8px;
  background-color: #000000;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  color: #eee;
}

#chat-send-btn {
  margin-left: 8px;
  padding: 8px 16px;
  background-color: #1e1e1e;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  color: #eee;
  cursor: pointer;
  transition: background-color 0.3s;
}

#chat-send-btn:hover {
  background-color: #388e3c;
}

.loading {
  color: #999;
  font-size: 1rem;
  width: 100%;
  text-align: center;
  padding: 20px 0;
}

/* 📱 반응형 모바일 대응 */
@media screen and (max-width: 768px) {
  #app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
  }

  #player-container {
    flex: none;
    height: 30vh;
    width: 100%;
  }

  #chat-container {
    flex: 1;
    min-height: 70vh;
    width: 100%;
    display: flex;
    flex-direction: column;
  }


  #chat-container {
    border-left: none;
    border-top: 2px solid #121212;
  }

  video {
    height: 100%;
    width: 100%;
  }

  #channel-list button {
    width: 45vw;
    height: 20vw;
    font-size: 1.2rem;
  }
}
