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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}

header h1 {
  color: #e94560;
  font-size: 1.5rem;
}

#user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#user-info span {
  color: #aaa;
}

#user-info button {
  background: transparent;
  border: 1px solid #e94560;
  color: #e94560;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

#user-info button:hover {
  background: #e94560;
  color: #fff;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* Auth Screen */
#auth-screen {
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.auth-container {
  background: #16213e;
  padding: 2rem;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
}

.tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #0f3460;
}

.tab {
  flex: 1;
  background: transparent;
  border: none;
  color: #aaa;
  padding: 0.8rem;
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.2s;
}

.tab:hover {
  color: #eee;
}

.tab.active {
  color: #e94560;
  border-bottom: 2px solid #e94560;
  margin-bottom: -1px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form input {
  background: #1a1a2e;
  border: 1px solid #0f3460;
  color: #eee;
  padding: 0.8rem;
  border-radius: 4px;
  font-size: 1rem;
}

.auth-form input:focus {
  outline: none;
  border-color: #e94560;
}

.auth-form button {
  background: #e94560;
  border: none;
  color: #fff;
  padding: 0.8rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-form button:hover {
  background: #d63850;
}

.error {
  color: #ff6b6b;
  font-size: 0.9rem;
  min-height: 1.2rem;
}

.success {
  color: #4ecdc4;
  font-size: 0.9rem;
  min-height: 1.2rem;
}

.link {
  color: #e94560;
  text-decoration: none;
  font-size: 0.9rem;
  text-align: center;
  display: block;
  margin-top: 0.5rem;
}

.link:hover {
  text-decoration: underline;
}

.subtitle {
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: center;
}

.auth-container h2 {
  color: #e94560;
  margin-bottom: 0.5rem;
  text-align: center;
}

#forgot-screen,
#reset-screen,
#verify-screen,
#resend-screen {
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: #666;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #0f3460;
}

.divider span {
  padding: 0 1rem;
}

/* Chat Screen */
#chat-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message {
  background: #16213e;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  max-width: 80%;
}

.message.own {
  align-self: flex-end;
  background: #0f3460;
}

.message-header {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.3rem;
}

.message-user {
  font-weight: 600;
  color: #e94560;
}

.message-guest {
  font-weight: 600;
  color: #4ecdc4;
}

.message-time {
  font-size: 0.75rem;
  color: #666;
}

.message-content {
  word-wrap: break-word;
  line-height: 1.4;
}

#message-form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  background: #16213e;
  border-top: 1px solid #0f3460;
}

#message-input {
  flex: 1;
  background: #1a1a2e;
  border: 1px solid #0f3460;
  color: #eee;
  padding: 0.8rem;
  border-radius: 4px;
  font-size: 1rem;
}

#message-input:focus {
  outline: none;
  border-color: #e94560;
}

#message-form button {
  background: #e94560;
  border: none;
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

#message-form button:hover {
  background: #d63850;
}

/* Scrollbar */
#messages::-webkit-scrollbar {
  width: 8px;
}

#messages::-webkit-scrollbar-track {
  background: #1a1a2e;
}

#messages::-webkit-scrollbar-thumb {
  background: #0f3460;
  border-radius: 4px;
}

#messages::-webkit-scrollbar-thumb:hover {
  background: #e94560;
}

/* Responsive */
@media (max-width: 600px) {
  .auth-container {
    padding: 1.5rem;
  }

  .message {
    max-width: 90%;
  }

  header h1 {
    font-size: 1.2rem;
  }
}
