:root {
  --light: #d4d4d4;
  --mid: #444444;
  --dark: #222222;
  --highlight: hsl(40 40% 50%);
}

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

body {
  height: 100vh;
  overflow: hidden;
}

#h9main {
  margin: auto;
  margin-top: 2rem;
  width: 800px;
  font-size: 120%;
}
#h9main h1 {
  margin-bottom: 1rem;
}
#h9main p {
  margin: 1rem 0;
}
#h9main a {
}
#h9main-demo { position: absolute; top: 0; left: 0; width: 100%; z-index: -100; }
#h9main-demo svg { width: 100%; height: 100%; }

.xbMain {
  display: flex;
  height: 100vh;
}

.xbMain.collapsed .xbSidebar {
  width: 50px;
}

.xbMain.collapsed .xbSidebar button {
  width: 100%;
  padding: 10px 5px;
}
.xbMain button {
  background: var(--mid);
  color: var(--light);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
  border: 2px solid transparent;
}
.xbMain button:hover {
  border-color: var(--highlight);
}

.xbSidebarTitle {
  margin: 10px 10px 0px 10px;
}
.xbSidebar {
  width: 200px;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: width 0.3s;
  color: var(--light);
}
.xbSidebarSection {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
}
.xbSidebar button {
  padding: 5px 10px;
  text-align: left;
}

.xbContent {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.xbLayout-two-over {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  height: 100%;
  gap: 2px;
  background: #333;
}

.xbLayout-stack {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr auto;
  height: 100%;
  gap: 2px;
  background: #333;
}

.xbLayout-two-over.noEditor .xbEditor,
.xbLayout-stack.noEditor .xbEditor {
  display: none;
}

.xbLayout-two-over.noEditor {
  grid-template-columns: 1fr;
}

.xbEditor {
  background: #1e1e1e;
  display: flex;
  flex-direction: column;
}
.xbEditor .xbToolbar button {
  background: var(--mid);
  color: var(--light);
  border-radius: 4px;
  transition: background 0.2s;
  border: 2px solid transparent;
  padding: 0 1rem;
}
.xbEditor textarea {
  flex: 1;
  background: var(--dark);
  color: var(--light);
  border: none;
  padding: 15px;
  font-family: monospace;
  resize: none;
  outline: none;
  line-height: 1.5;
}

.xbPreview {
  background: var(--mid);
  overflow: auto;
}
.xbPreview #demoOutput {
  width: 100%;
  height: 100%;
  border: none;
  padding: 5px;
}
#demoOutput svg {
  width: 100%;
  height: 100%;
  background: #fff;
}
#demoOutput canvas {
  background: #fff;
}
#manyWorldsGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-row-height: 50%;
  width: 100%;
  height: 100%;
}
#manyWorldsGrid svg {
  height: 300px;
}

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--mid);
}
