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

:root {
  --bg: #041f39;
  --bg-accent: #0f4470;
  --text: #f5f7fb;
  --muted: #c3cfde;
  --primary: #42b4ff;
  --primary-hover: #2f9ce2;
  --secondary: #ffffff;
  --secondary-text: #0a3558;
  --shadow-soft: 0 20px 40px rgba(7, 15, 30, 0.5);
  --radius-lg: 22px;
  --transition: 0.18s ease-out;
  --font-main: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-main);
  background: linear-gradient(135deg, #05284b, #03182d 55%);
  color: var(--text);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 32px;
}

/* Layout */

.app {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Header */

.app-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-bottom: 24px;
}

.logo {
  font-size: 2.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: #fafdff;
  text-shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
  margin-right: 18px;
}

.tagline {
  color: rgba(245, 247, 251, 0.75);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Main card */

.app-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: linear-gradient(160deg, rgba(16, 40, 73, 0.95), rgba(7, 26, 45, 0.92));
  padding: 32px 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  width: 100%;
  max-width: 520px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.card-heading {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.card-subheading {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
}

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

/* Buttons + inputs */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 14px 20px;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
    background-color var(--transition), color var(--transition),
    border-color var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.actions .btn {
  width: 100%;
}

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.btn-secondary:hover {
  background: #f4f6fb;
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(5, 19, 36, 0.7);
  color: var(--text);
  font-size: 1.05rem;
  outline: none;
  margin-bottom: 14px;
  transition: border-color var(--transition), box-shadow var(--transition),
    background-color var(--transition);
}

.chat-input-row .input {
  font-size: 1.05rem;
  padding: 18px 18px;
  border-radius: 18px;
}

.input::placeholder {
  color: rgba(195, 207, 222, 0.8);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(66, 180, 255, 0.7);
  background: rgba(3, 18, 40, 0.9);
}

/* Divider */

.divider {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 4px 0;
}

/* Join block */

.join-section {
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* Chat layout */

#chat-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.chat-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2px;
}

.chat-session {
  font-size: 0.85rem;
  color: var(--muted);
}

.chat-log {
  flex: 1;
  min-height: 220px;
  max-height: 420px;
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(4, 15, 30, 0.8);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(3, 12, 24, 0.7);
  border-radius: 22px;
  padding: 4px 6px 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-input-row .input {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
  border: none;
  background: transparent;
  height: 44px;
  line-height: 44px;
  padding: 0;
}

.chat-send-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.chat-send-btn .send-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.chat-message {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 1rem;
  max-width: 80%;
}

.chat-message.me {
  align-self: flex-end;
  background: var(--primary);
  color: #ffffff;
}

.chat-message.them {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
}

.chat-message.system {
  align-self: center;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Responsive tweaks */

@media (max-width: 480px) {
  .logo {
    font-size: 1.9rem;
    letter-spacing: 0.1em;
  }

  .card {
    padding: 22px 18px;
  }
}
