:root {
  color-scheme: dark;
  --bg: #111315;
  --panel: #1a1d20;
  --panel-2: #22262a;
  --text: #f0eee8;
  --muted: #a8a39a;
  --line: #333941;
  --gold: #d7b66a;
  --green: #78d99b;
  --red: #e27777;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  min-height: 40px;
  padding: 0 12px;
  font: inherit;
  cursor: pointer;
}

button:hover {
  border-color: var(--gold);
}

button.active {
  background: #3a2f16;
  border-color: var(--gold);
  color: #ffe4a3;
}

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

.stage {
  position: relative;
  min-width: 0;
  background:
    radial-gradient(circle at 48% 55%, rgba(215, 182, 106, 0.16), transparent 28%),
    linear-gradient(180deg, #171a1d 0%, #0e1012 100%);
}

.canvas-wrap {
  width: 100%;
  height: 100%;
}

.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.status-bar {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(17, 19, 21, 0.72);
  color: var(--muted);
  font-size: 13px;
}

.status-bar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel {
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--panel);
  padding: 24px;
}

.panel header {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

section + section {
  margin-top: 28px;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

pre {
  min-height: 160px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101214;
  color: #d8d3c8;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .stage {
    height: 62vh;
    min-height: 430px;
  }

  .panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
