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

:root {
  --bg:       #0f1117;
  --surface:  #1a1d27;
  --surface2: #22263a;
  --border:   #2e3348;
  --accent:   #6c63ff;
  --accent2:  #00d4aa;
  --danger:   #ff4d6d;
  --text:     #e4e6f1;
  --muted:    #6b7280;
  --radius:   10px;
  --mono:     'JetBrains Mono', 'Fira Code', monospace;
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* ===== Utility ========================================================= */
.hidden   { display: none !important; }
.muted    { color: var(--muted); }
.mono     { font-family: var(--mono); }

button {
  cursor: pointer;
  font: inherit;
  border: none;
  border-radius: var(--radius);
  transition: background .15s, opacity .15s;
}
button:hover { opacity: .85; }
button:disabled { opacity: .4; cursor: default; }

input, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  outline: none;
  width: 100%;
  transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--accent); }

/* ===== Landing (marketing page) ======================================== */
html.in-room #landing { display: none; }   /* avoid content flash on room URLs */
html.in-room .ignlab-footer { display: none !important; }  /* footer is homepage-only */

#landing {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
  padding: clamp(64px, 12vh, 130px) 0 80px;
}

.hero-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  letter-spacing: .3px;
}

.hero h1 {
  font-size: clamp(30px, 5.5vw, 54px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  max-width: 760px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--text);
  opacity: .8;
  font-size: clamp(15px, 2.2vw, 18px);
  line-height: 1.6;
  max-width: 580px;
}

.btn-hero {
  font-size: 16px;
  padding: 15px 36px;
  border-radius: 999px;
  box-shadow: 0 4px 30px rgba(108,99,255,.45);
}

.hero-note { font-size: 12px; }

/* Generic landing section */
.lp-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.lp-section h2 {
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 800;
  letter-spacing: -.5px;
  text-align: center;
  margin-bottom: 36px;
}

/* Feature cards */
.lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}
.lp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 24px;
  transition: border-color .2s, transform .2s;
}
.lp-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.lp-icon { font-size: 30px; margin-bottom: 12px; }
.lp-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.lp-card p  { color: var(--muted); font-size: 14px; line-height: 1.6; }

/* Steps */
.lp-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.lp-step { display: flex; gap: 16px; align-items: flex-start; }
.lp-step-n {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  border-radius: 50%;
}
.lp-step h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.lp-step p  { color: var(--muted); font-size: 14px; line-height: 1.55; }

/* Benefits */
.lp-benefits {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
}
.lp-benefits li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}
.lp-benefits strong { color: var(--text); }

/* FAQ */
.lp-faq { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.lp-faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 18px;
}
.lp-faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 0;
  list-style: none;
}
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: '+'; float: right; color: var(--accent); font-size: 18px; }
.lp-faq details[open] summary::after { content: '−'; }
.lp-faq details p { color: var(--muted); font-size: 14px; line-height: 1.6; padding: 0 0 16px; }

/* Recent workspaces */
.recent-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}
.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, transform .15s;
}
.recent-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.recent-name { font-weight: 600; font-size: 14px; }
.recent-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.recent-host {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Footer */
.lp-footer { text-align: center; padding-top: 48px; border-top: 1px solid var(--border); }
.lp-footer p { font-size: 13px; margin: 4px 0; }
.lp-footer a { color: var(--accent2); text-decoration: none; }
.lp-footer a:hover { text-decoration: underline; }

/* ===== Modal (nickname entry) ========================================== */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  width: min(420px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-box h2 { font-size: 22px; font-weight: 700; }
.modal-box p  { color: var(--muted); font-size: 13px; }

#btn-join {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 10px;
}

/* ===== App shell ======================================================= */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Top bar ========================================================= */
#topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

#topbar .logo {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.5px;
}

#room-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  transition: border-color .15s;
}
#room-link:hover { border-color: var(--accent); color: var(--text); }

#nick-badge {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}
#nick-badge span {
  color: var(--accent2);
  font-weight: 600;
}

/* Presence dots */
#presence {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.presence-chip {
  font-size: 11px;
  font-weight: 600;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--accent2);
}

/* ===== Feature tabs ===================================================== */
#tab-bar {
  display: flex;
  gap: 4px;
  padding: 10px 20px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== Content area ===================================================== */
#content {
  flex: 1;
  padding: 24px 20px;
  overflow-y: auto;
}

/* ===== Section headers ================================================== */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-header h2 {
  font-size: 18px;
  font-weight: 700;
}

/* ===== Button variants ================================================== */
.btn-primary   { background: var(--accent);  color: #fff; font-weight: 600; padding: 8px 18px; }
.btn-secondary { background: var(--surface2); color: var(--text); font-weight: 500; padding: 8px 18px; border: 1px solid var(--border); }
.btn-danger    { background: var(--danger);  color: #fff; font-weight: 600; padding: 8px 18px; }
.btn-ghost     { background: transparent; color: var(--muted); padding: 6px 12px; border: 1px solid var(--border); }
.btn-sm        { padding: 5px 12px; font-size: 12px; }

/* ===== Poker tab ======================================================= */
#poker-task-row {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
#poker-task-row input { flex: 1; min-width: 200px; }

.system-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.system-toggle button {
  padding: 7px 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.system-toggle button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Vote cards row */
#vote-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.vote-card {
  width: 56px;
  height: 80px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.vote-card:hover { border-color: var(--accent); background: var(--surface); }
.vote-card.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Team members grid */
#team-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 110px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .2s;
}
.team-card .tc-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.team-card .tc-value {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--mono);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-card.voted    { border-color: var(--accent); }
.team-card.revealed { border-color: var(--accent2); }
.team-card .tc-dot  {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  margin: 0 auto;
}

.poker-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

#poker-avg {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent2);
  font-weight: 700;
}

/* ===== Retro tab ======================================================== */
#retro-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.retro-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.retro-col h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.retro-add-row {
  display: flex;
  gap: 6px;
}
.retro-add-row input { font-size: 13px; padding: 6px 10px; }
.retro-add-row button {
  padding: 6px 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.retro-cards { display: flex; flex-direction: column; gap: 8px; }

.retro-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: fadein .2s ease;
}

@keyframes fadein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; } }

.retro-card .rc-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.rc-vote-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.rc-vote-btn:hover { border-color: var(--accent2); color: var(--accent2); }
.rc-vote-btn.bumped { color: var(--accent2); border-color: var(--accent2); }

/* ===== Kanban tab ======================================================= */
#kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 300px;
}

.kanban-col h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.kanban-count {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  padding: 1px 7px;
  color: var(--muted);
  font-weight: 600;
}

.kanban-add-row { display: flex; gap: 6px; }
.kanban-add-row input { font-size: 13px; padding: 6px 10px; }
.kanban-add-row button {
  padding: 6px 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.kanban-cards { display: flex; flex-direction: column; gap: 8px; flex: 1; }

.kanban-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: fadein .2s ease;
}
.kanban-card .kc-text { flex: 1; word-break: break-word; }

.kc-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.kc-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.kc-btn:hover { border-color: var(--accent); color: var(--text); }
.kc-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ===== Toast ============================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  animation: fadein .2s ease;
}
.toast.ok     { border-left: 3px solid var(--accent2); }
.toast.error  { border-left: 3px solid var(--danger); }

/* ===== Responsive tweaks ================================================ */
@media (max-width: 540px) {
  #topbar { padding: 10px 14px; }
  #content { padding: 16px 12px; }
  #tab-bar { padding: 8px 12px 0; overflow-x: auto; }
  .tab-btn { font-size: 12px; padding: 8px 12px; white-space: nowrap; }
}
