:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #191b20;
  --line: #2d3038;
  --text: #f2f0ea;
  --muted: #aaa49a;
  --accent: #d4ff6a;
  --accent-2: #6fd7ff;
  --danger: #ff8585;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 100vh;
}

.stage {
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr);
  gap: 18px;
  padding: 28px;
}

.brand h1,
.chat-header h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: clamp(2rem, 7vw, 5rem);
  line-height: 0.95;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.player {
  min-height: 0;
  border: 1px solid var(--line);
  background: #050608;
  aspect-ratio: 16 / 9;
  align-self: start;
}

.player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.empty {
  display: grid;
  min-height: 280px;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  border-left: 1px solid var(--line);
  background: var(--panel);
  min-height: 100vh;
  padding: 20px;
}

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

.status {
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.74rem;
  padding: 5px 8px;
}

.gate,
.composer {
  display: grid;
  gap: 10px;
}

.gate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #101217;
  color: var(--text);
  padding: 10px;
  border-radius: 0;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

button {
  border: 0;
  background: var(--accent);
  color: #101114;
  cursor: pointer;
  font-weight: 800;
  padding: 10px 14px;
}

button:hover {
  filter: brightness(1.04);
}

.chat {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  gap: 14px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.message {
  border: 1px solid var(--line);
  background: #111319;
  padding: 10px;
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.message strong {
  color: var(--accent-2);
}

.message p {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.error {
  min-height: 1em;
  margin: 0;
  color: var(--danger);
}

.hidden {
  display: none;
}

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

  .stage {
    padding: 18px;
  }

  .chat-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    min-height: 55vh;
  }
}
