:root {
  --bg: #12140f;
  --panel: #1c2118;
  --ink: #e8edd9;
  --mute: #8a9378;
  --line: #2a3224;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 14px 18px;
  gap: 10px;
}

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

h1 {
  font-size: 22px;
  letter-spacing: 0.18em;
  margin: 0;
  font-weight: 600;
}

#stage {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 10px;
  flex: 1;
}

canvas {
  width: 100%;
  height: auto;
  min-height: 280px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #1a140e;
  border: 2px solid #3d3428;
  display: block;
}

#log {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 10px 12px;
  overflow: auto;
  min-height: 220px;
  max-height: 70vh;
  font-size: 13px;
  line-height: 1.45;
}

#log .meta { color: var(--mute); font-size: 11px; margin-bottom: 8px; }
#log .line { margin: 0 0 8px; }
#log .who { font-weight: 600; margin-right: 6px; }

#hud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

button {
  font: inherit;
  background: #2f3a26;
  color: var(--ink);
  border: 1px solid #4a5a38;
  padding: 8px 14px;
  cursor: pointer;
}
button:hover { background: #3a482e; }
button:disabled { opacity: 0.45; cursor: default; }

.status { color: var(--mute); font-size: 12px; }

@media (max-width: 820px) {
  #stage { grid-template-columns: 1fr; }
  #log { max-height: 38vh; }
}
