* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; overflow-x: hidden; min-height: 100vh; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  width: 100%;
}

.header {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 1.5rem 2rem;
  color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1rem;
  opacity: 0.9;
  font-weight: 300;
}

.online-users {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
}

.online-icon {
  font-size: 0.75rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.disclaimer-banner {
  background: #fbbf24;
  color: #78350f;
  padding: 1rem;
}

.disclaimer-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.9rem;
}

.warning-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.disclaimer-text {
  flex: 1;
}

.close-disclaimer {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #78350f;
  padding: 0.25rem 0.5rem;
}

.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.start-screen, .waiting-screen, .chat-container {
  background: rgba(255, 255, 255, 0.95);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.start-content {
  margin-bottom: 2rem;
}

.user-info {
  padding: 1rem 1.5rem;
  background: #f3f4f6;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.user-label {
  color: #6b7280;
  font-size: 0.9rem;
  margin-right: 0.5rem;
}

.username {
  color: #667eea;
  font-weight: 600;
  font-size: 1.2rem;
}

.start-button, .cancel-button, .disconnect-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1rem 3rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  margin-top: 1rem;
  transition: transform 0.2s;
}

.start-button:hover, .cancel-button:hover, .disconnect-button:hover {
  transform: translateY(-2px);
}

.cancel-button, .disconnect-button {
  background: #ef4444;
}

.guidelines {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e5e7eb;
}

.guidelines h3 {
  margin-bottom: 1rem;
  color: #374151;
}

.guidelines ul {
  list-style: none;
  text-align: left;
  display: inline-block;
}

.guidelines li {
  padding: 0.5rem 0;
  color: #6b7280;
}

.spinner {
  border: 4px solid rgba(102, 126, 234, 0.1);
  border-top-color: #667eea;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 2rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.chat-container {
  max-width: 800px;
  display: flex;
  flex-direction: column;
  height: 70vh;
  max-height: 800px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 2px solid #e5e7eb;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px 20px 0 0;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-weight: 600;
}

.status-indicator {
  width: 12px;
  height: 12px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: #f9fafb;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #9ca3af;
  font-style: italic;
}

.message {
  margin-bottom: 1rem;
  display: flex;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.own-message {
  justify-content: flex-end;
}

.other-message {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: 18px;
}

.own-message .message-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.other-message .message-bubble {
  background: white;
  color: #374151;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-time {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

.message-input-form {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 2px solid #e5e7eb;
  background: white;
}

.message-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 25px;
  font-size: 1rem;
}

.message-input:focus {
  border-color: #667eea;
  outline: none;
}

.send-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
}

.send-button:hover {
  transform: translateY(-2px);
}

.footer {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  text-align: center;
  color: white;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 1rem;
  }
  .start-screen, .waiting-screen {
    padding: 2rem 1.5rem;
  }
}

