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

:root {
  --bg: #0a0a0c;
  --bg-elevated: #121216;
  --panel: #16161a;
  --border: #2a2a32;
  --text: #e4e4e7;
  --muted: #71717a;
  --scientist: #3b82f6;
  --cheerleader: #f59e0b;
  --memer: #ec4899;
  --judge: #8b5cf6;
  --accent: #22c55e;
}

body {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.matrix-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(34, 197, 94, 0.06) 0%, transparent 55%),
    linear-gradient(180deg, #0a0a0c 0%, #050506 100%);
  pointer-events: none;
  z-index: 0;
}

.header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.header h1 {
  color: var(--accent);
  font-size: 1.5rem;
  text-shadow: 0 0 16px rgba(34, 197, 94, 0.35);
  letter-spacing: 0.05em;
}

.subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  min-height: calc(100vh - 80px);
}

.sidebar section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.sidebar h2 {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

#topicInput {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

#topicInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}

.btn-primary,
.btn-secondary {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.btn-primary {
  background: rgba(34, 197, 94, 0.12);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.22);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

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

.btn-secondary {
  background: transparent;
  color: var(--muted);
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--muted);
}

.role-list {
  list-style: none;
}

.role-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.35rem 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.scientist { background: var(--scientist); }
.dot.cheerleader { background: var(--cheerleader); }
.dot.memer { background: var(--memer); }
.dot.judge { background: var(--judge); }

.tech-note p {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-height: 500px;
}

.status-bar {
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.status-bar.active {
  color: var(--accent);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.msg {
  border-left: 3px solid;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border-radius: 0 6px 6px 0;
  animation: fadeIn 0.35s ease;
}

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

.msg-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.msg-name {
  font-weight: bold;
}

.msg-round {
  color: var(--muted);
  font-size: 0.7rem;
}

.msg-content {
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.typing .msg-content {
  color: var(--muted);
  font-style: italic;
}

.msg.status {
  border-left-color: var(--muted);
  font-size: 0.8rem;
  color: var(--muted);
}

.msg.error {
  border-left-color: #ef4444;
  color: #fca5a5;
}

.msg.done {
  border-left-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
}
