:root {
  --bg: #0c0c0e;
  --panel: #141416;
  --text: #e4e4e6;
  --dim: #84848a;
  --accent: #ff9430;
  --line: #2a2a2e;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Segoe UI, Roboto, Helvetica, Arial, sans-serif; }

header { padding: 28px 32px 12px; max-width: 1320px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; object-fit: cover; background: #141416; }
.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wordmark .name { font-size: 26px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.wordmark .hud { font-size: 12px; font-weight: 700; letter-spacing: 0.28em; color: var(--accent); margin-top: 4px; }
header p { color: var(--dim); max-width: 560px; line-height: 1.45; }
.download {
  display: inline-block;
  margin-top: 8px;
  background: var(--accent);
  color: #1a1008;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 6px;
}

main {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding: 12px 32px 40px;
  max-width: 1320px;
}

aside { max-height: calc(100vh - 160px); overflow: auto; padding-right: 4px; }
aside h2 { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; margin: 18px 0 8px; }
aside h2:first-child { margin-top: 0; }
aside button[data-widget] {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
}
aside button[data-widget].on { border-color: var(--accent); color: var(--accent); }
.layout-toggle { margin: 16px 0 4px; }

.section { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; margin: 14px 0 8px; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  min-height: 32px;
}
.row label { font-size: 13px; color: var(--text); }
.row.stack { display: block; }
.row.stack label { display: block; margin-bottom: 6px; }

.toggle {
  appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #2a2a2e;
  border: 0;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle:checked { background: var(--accent); }
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.12s ease;
}
.toggle:checked::after { left: 19px; }

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button, .snap button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
}
.stepper span { min-width: 24px; text-align: center; font-size: 13px; }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.range-val { color: var(--dim); font-size: 12px; min-width: 36px; text-align: right; }

select {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
}

.snap {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  gap: 6px;
  justify-content: start;
}

.stage {
  background:
    radial-gradient(ellipse at 50% 30%, #2a2218 0%, transparent 55%),
    linear-gradient(#161412, #0a0a0c);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
#hud { width: 100%; height: auto; display: block; aspect-ratio: 16 / 9; touch-action: none; }
.hint { position: absolute; right: 12px; bottom: 8px; margin: 0; color: var(--dim); font-size: 12px; }

@media (max-width: 800px) {
  main { grid-template-columns: 1fr; padding: 12px 16px 32px; }
  header { padding: 20px 16px 8px; }
  aside { max-height: none; }
}
