/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream:   #F5F2EC;
  --ink:     #1A1814;
  --muted:   #6B6760;
  --border:  rgba(26,24,20,0.12);
  --purple:  #534AB7;
  --purple-light: #EEEDFE;
  --purple-mid:   #AFA9EC;
  --green-light:  #E1F5EE;
  --green-dark:   #085041;
  --green-mid:    #5DCAA5;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans:  'DM Sans', system-ui, sans-serif;
}

html { font-size: 16px; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Screens ── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* ── LANDING ── */
.landing-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
  text-align: center;
  gap: 2.5rem;
}

.logo-mark {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -1px;
  line-height: 1.05;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: clamp(1rem, 3vw, 1.125rem);
  color: var(--muted);
  line-height: 1.7;
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

.landing-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  border-top: 0.5px solid var(--border);
  padding-top: 2rem;
  width: 100%;
  max-width: 420px;
}

.lstat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lnum { font-family: var(--serif); font-size: 1.75rem; font-weight: 400; }
.llab { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }

/* ── Buttons ── */
.btn-main {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 14px 24px;
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-main:hover { opacity: 0.85; }
.btn-main:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-ghost {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0.5rem auto 0;
  padding: 12px 24px;
  background: transparent;
  color: var(--ink);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-ghost:hover { background: rgba(26,24,20,0.05); }

.btn-back {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0.5rem auto 0;
  padding: 12px;
  background: transparent;
  color: var(--muted);
  border: none;
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}
.btn-back:hover { color: var(--ink); }

.btn-sm {
  display: inline-block;
  padding: 9px 20px;
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 10px;
  transition: opacity 0.15s;
}
.btn-sm:hover { opacity: 0.85; }

/* ── ONBOARDING ── */
.onboard-wrap {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

.onboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.logo-sm {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: -0.3px;
}

.progress-bar {
  display: flex;
  gap: 5px;
}
.prog-step {
  width: 28px; height: 3px;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.2s;
}
.prog-step.done { background: var(--ink); }
.prog-step.active { background: var(--purple); }

.q-block { animation: fadeUp 0.2s ease; }

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

.q-num { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.q-title { font-family: var(--serif); font-size: clamp(1.35rem, 5vw, 1.75rem); font-weight: 400; line-height: 1.3; margin-bottom: 6px; }
.q-hint { font-size: 13px; color: var(--muted); margin-bottom: 1.25rem; }
.q-label { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 8px; margin-top: 1.25rem; text-transform: uppercase; letter-spacing: 0.06em; }

.pill-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.5rem; }
.pill {
  padding: 8px 16px;
  border-radius: 20px;
  border: 0.5px solid var(--border);
  background: white;
  color: var(--ink);
  font-size: 14px;
  font-family: var(--sans);
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
}
.pill:hover { border-color: var(--purple); color: var(--purple); }
.pill.selected { background: var(--purple-light); border-color: var(--purple-mid); color: var(--purple); }

.text-field {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  margin-bottom: 8px;
  resize: vertical;
  transition: border-color 0.15s;
}
.text-field:focus { outline: none; border-color: var(--purple); }

.field-hint { font-size: 12px; color: var(--muted); margin-bottom: 1.25rem; line-height: 1.5; }

/* ── RANK REVEAL ── */
.rank-wrap {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.rank-card {
  width: 100%;
  background: var(--purple-light);
  border: 0.5px solid var(--purple-mid);
  border-radius: var(--radius-md);
  padding: 2.25rem 1.5rem;
}
.rank-emoji { font-size: 3.5rem; margin-bottom: 12px; }
.rank-badge {
  display: inline-block;
  background: var(--purple);
  color: white;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.rank-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: #2E2880;
  margin-bottom: 8px;
}
.rank-desc { font-size: 14px; color: var(--purple); line-height: 1.6; }

.stat-row { display: flex; gap: 12px; width: 100%; }
.stat-box {
  flex: 1;
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  text-align: center;
}
.stat-val { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; }
.stat-lab { font-size: 12px; color: var(--muted); margin-top: 2px; }

.rank-note { font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 320px; }

/* ── CHECK-IN ── */
.checkin-wrap {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}
.checkin-title { font-family: var(--serif); font-size: 1.75rem; font-weight: 400; margin-bottom: 4px; }
.checkin-sub { font-size: 13px; color: var(--muted); margin-bottom: 1.5rem; }

.streak-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.75rem;
}
.s-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 500;
}
.s-dot.done  { background: var(--green-light); color: var(--green-dark); }
.s-dot.today { background: var(--ink); color: var(--cream); }
.s-dot.empty { background: rgba(26,24,20,0.06); color: var(--muted); border: 0.5px solid var(--border); }

/* ── WAITING ROOM ── */
.room-wrap {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.room-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.room-identity { display: flex; align-items: center; gap: 10px; }
.room-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--purple-light);
  border: 0.5px solid var(--purple-mid);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--purple);
}
.room-name  { font-size: 15px; font-weight: 500; }
.room-rank-label { font-size: 12px; color: var(--muted); }
.online-pill {
  font-size: 12px;
  background: var(--green-light);
  color: var(--green-dark);
  border: 0.5px solid var(--green-mid);
  padding: 4px 10px;
  border-radius: 20px;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--purple); border-bottom-color: var(--purple); font-weight: 500; }

.tab-panel { display: none; flex-direction: column; flex: 1; }
.tab-panel.active { display: flex; }

/* ── Chat ── */
.daily-prompt {
  background: var(--green-light);
  border: 0.5px solid var(--green-mid);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--green-dark);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.chat-area {
  flex: 1;
  min-height: 300px;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.msg { max-width: 82%; }
.msg.mine  { align-self: flex-end; }
.msg.theirs { align-self: flex-start; }
.msg-meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.mine .msg-meta { text-align: right; }
.msg-bubble {
  padding: 9px 13px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 12px;
}
.mine .msg-bubble   { background: var(--ink); color: var(--cream); border-radius: 12px 12px 3px 12px; }
.theirs .msg-bubble { background: white; color: var(--ink); border: 0.5px solid var(--border); border-radius: 12px 12px 12px 3px; }

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-bottom: 0.75rem;
}
.chat-input {
  flex: 1;
  padding: 10px 13px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  resize: none;
  transition: border-color 0.15s;
}
.chat-input:focus { outline: none; border-color: var(--purple); }
.send-btn {
  padding: 10px 18px;
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.send-btn:hover { opacity: 0.85; }

/* ── Vents / Roast / Hired ── */
.post-area {
  margin-bottom: 1.25rem;
}
.room-note { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 1rem; }

.vent-card, .roast-card, .hired-card {
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
  margin-bottom: 10px;
}
.card-anon  { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.card-body  { font-size: 14px; color: var(--ink); line-height: 1.6; }
.card-react { font-size: 12px; color: var(--muted); margin-top: 10px; cursor: pointer; }
.card-react:hover { color: var(--ink); }
.card-author { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.card-snippet { font-size: 13px; color: var(--muted); font-style: italic; margin-bottom: 10px; line-height: 1.5; }
.card-feedback { font-size: 13px; color: var(--ink); line-height: 1.6; padding-top: 10px; border-top: 0.5px solid var(--border); }
.card-role   { font-size: 14px; font-weight: 500; color: var(--ink); }
.card-meta   { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card-tip    { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.hired-badge {
  display: inline-block;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 10px;
  font-weight: 500;
}
.hired-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }

/* ── Nav bar ── */
.nav-bar {
  display: flex;
  border-top: 0.5px solid var(--border);
  margin-top: auto;
  background: var(--cream);
  position: sticky;
  bottom: 0;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 8px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s;
}
.nav-item:hover { color: var(--ink); }
.nav-item svg { flex-shrink: 0; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .landing-stats { gap: 1.25rem; }
  .room-wrap { padding: 1rem 1rem 0; }
}
