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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  height: 100%;
  overflow: hidden;
}

/* Landing Page */
.container {
  max-width: 400px;
  margin: 0 auto;
  padding: 60px 20px;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: auto;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
  color: #fff;
}

.tagline {
  color: #666;
  margin-bottom: 48px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn {
  padding: 14px 28px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #222;
  color: #fff;
  transition: background 0.2s;
}

.btn:hover:not(:disabled) {
  background: #333;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary {
  background: #2563eb;
}

.btn.primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.divider {
  color: #444;
  font-size: 0.9rem;
}

.join-form {
  display: flex;
  gap: 8px;
}

.join-form input {
  flex: 1;
  padding: 14px 16px;
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: 4px;
  border: 2px solid #222;
  border-radius: 8px;
  background: #111;
  color: #fff;
  text-transform: uppercase;
}

.join-form input:focus {
  outline: none;
  border-color: #2563eb;
}

.error {
  color: #ef4444;
  font-size: 0.9rem;
  min-height: 24px;
}

/* Chat Page */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid #222;
  flex-shrink: 0;
}

.back {
  color: #666;
  text-decoration: none;
  font-size: 1.5rem;
}

.back:hover {
  color: #fff;
}

.room-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.room-code {
  font-size: 1.5rem;
  font-weight: bold;
  font-family: monospace;
  letter-spacing: 2px;
  color: #fff;
}

.user-count {
  color: #666;
  font-size: 0.9rem;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  background: #1a1a1a;
}

.message.own {
  align-self: flex-end;
  background: #2563eb;
}

.message .meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 4px;
}

.message.own .meta {
  color: rgba(255, 255, 255, 0.6);
}

.message .text {
  word-wrap: break-word;
}

.system-message {
  text-align: center;
  color: #444;
  font-size: 0.85rem;
  padding: 8px;
}

.message-form {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid #222;
  flex-shrink: 0;
}

.message-form input {
  flex: 1;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid #222;
  border-radius: 8px;
  background: #111;
  color: #fff;
}

.message-form input:focus {
  outline: none;
  border-color: #2563eb;
}

.message-form button {
  padding: 12px 24px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

.message-form button:hover {
  background: #1d4ed8;
}
