:root {
  --bg: #09090b;
  --surface: #111113;
  --border: #1c1c1f;
  --text: #e4e4e7;
  --text-dim: #52525b;
  --text-muted: #71717a;
  --dot-on: #22c55e;
  --dot-off: #3f3f46;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout ---- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---- Header ---- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  flex: 1;
}

.clear-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.clear-btn:active {
  color: #ef4444;
  border-color: #ef4444;
}

.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

.room-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot-off);
  transition: background 0.3s;
}

.dot.connected {
  background: var(--dot-on);
  box-shadow: 0 0 6px var(--dot-on);
}

/* ---- Editor ---- */
.editor-area {
  flex: 1;
  padding: 2rem 0;
  overflow: hidden;
}

.editor {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.75;
  letter-spacing: -0.01em;
  caret-color: var(--text);
}

.editor::placeholder {
  color: var(--text-dim);
  font-style: normal;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .app { padding: 0 1.25rem; }
  .editor { font-size: 1rem; }
  .header { flex-wrap: wrap; gap: 0.75rem; }
  .brand { flex: 0 0 auto; }
  .clear-btn { flex: 0 0 auto; }
  .header-right { flex: 0 0 100%; justify-content: space-between; }
}
