/* Yay — Watch Together */
/* Light mode Twitch-like */

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f7f7f8;
  color: #1a1a1a;
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* === Join Overlay === */
#join-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#join-box {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  min-width: 320px;
}

#join-box h1 {
  font-size: 32px;
  color: #9147ff;
  margin-bottom: 8px;
}

#join-box p {
  color: #666;
  margin-bottom: 20px;
  font-size: 14px;
}

#username-input {
  width: 100%;
  padding: 10px 16px;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  margin-bottom: 12px;
  text-align: center;
}

#username-input:focus {
  border-color: #9147ff;
}

#join-btn {
  width: 100%;
  padding: 12px;
  background: #9147ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

#join-btn:hover {
  background: #772ce8;
}

/* === Top Bar === */
#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: #18181b;
  color: #fff;
  height: 48px;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  color: #bf94ff;
}

#viewer-count {
  font-size: 13px;
  color: #aaa;
}

/* === Content Layout === */
#content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

#left-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 12px;
  padding: 12px;
}

/* === Player === */
#player-container {
  width: 100%;
  background: #000;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  max-height: 60vh;
}

#video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* === Avatar Theater === */
#avatar-theater {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e5e5;
}

.theater-empty {
  color: #aaa;
  font-size: 14px;
  padding: 20px;
}

.theater-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.theater-seat {
  width: 48px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

.theater-seat:hover {
  transform: scale(1.15);
  z-index: 2;
}

.theater-seat.empty {
  background: #e8e8ed;
}

@keyframes seatPopIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* === Chat Panel === */
#chat-panel {
  width: 340px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid #e5e5e5;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-message {
  font-size: 13px;
  line-height: 1.4;
  padding: 2px 0;
  word-break: break-word;
}

.chat-message.system {
  color: #999;
  font-style: italic;
  font-size: 12px;
}

.chat-username {
  font-weight: 700;
  margin-right: 2px;
}

.chat-text {
  color: #1a1a1a;
}

#chat-input-area {
  display: flex;
  padding: 8px 12px;
  gap: 8px;
  border-top: 1px solid #e5e5e5;
  background: #f7f7f8;
}

#chat-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d5d5d5;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

#chat-input:focus {
  border-color: #9147ff;
}

#chat-send {
  padding: 8px 16px;
  background: #9147ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#chat-send:hover {
  background: #772ce8;
}

/* === Responsive: mobile === */
@media (max-width: 768px) {
  #content {
    flex-direction: column;
  }

  #chat-panel {
    width: 100%;
    height: 40vh;
    border-left: none;
    border-top: 1px solid #e5e5e5;
  }

  #player-container {
    max-height: 40vh;
  }
}
