:root {
  --bg: #10131a;
  --card: #1a1f2b;
  --accent: #5b7cff;
  --accent-2: #ff6b6b;
  --text: #e8eaf0;
  --muted: #8a91a6;
  --bubble-me: #5b7cff;
  --bubble-them: #262c3b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top, #1b2033, #0b0d13 70%);
  color: var(--text);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#app { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

.screen { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.screen.hidden { display: none; }

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 36px 32px;
  width: 380px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  text-align: center;
}

h1 { margin: 0 0 4px; font-size: 28px; letter-spacing: -0.5px; }
h2 { margin: 0 0 4px; }
.tagline { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; background: #0f1320; border-radius: 12px; padding: 4px; }
.tab {
  flex: 1; padding: 10px; border: none; background: transparent; color: var(--muted);
  border-radius: 8px; cursor: pointer; font-weight: 600;
}
.tab.active { background: var(--accent); color: white; }

.tab-panel { display: none; flex-direction: column; gap: 12px; }
.tab-panel.active { display: flex; }

input[type="text"], input[type="password"] {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #2a3040;
  background: #0f1320;
  color: var(--text);
  font-size: 14px;
}
input:focus { outline: 2px solid var(--accent); }

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); text-align: left; }

button {
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
button:hover { filter: brightness(1.1); }
button.secondary { background: transparent; color: var(--muted); margin-top: 12px; }

.error { color: var(--accent-2); font-size: 13px; min-height: 18px; margin: 4px 0 0; }

#find-btn { width: 100%; margin-top: 8px; font-size: 16px; padding: 16px; }
#lobby-status { color: var(--muted); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* Chat screen */
#chat-screen { flex-direction: column; align-items: stretch; max-width: 480px; margin: 0 auto; height: 100vh; }
.chat-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; background: var(--card); font-weight: 600;
}
.chat-actions button { background: transparent; font-size: 16px; padding: 6px 10px; }

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg { max-width: 75%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.msg.me { align-self: flex-end; background: var(--bubble-me); color: white; border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; background: var(--bubble-them); border-bottom-left-radius: 4px; }
.msg.system { align-self: center; color: var(--muted); font-size: 12px; background: transparent; }

#message-form { display: flex; gap: 8px; padding: 16px 20px; background: var(--card); }
#message-input {
  flex: 1; padding: 12px 14px; border-radius: 10px; border: 1px solid #2a3040;
  background: #0f1320; color: var(--text);
}
