:root {
  --bg: #0d1117;
  --panel: #141b24;
  --line: #22303d;
  --text: #d7e2ee;
  --dim: #7f93a8;
  --accent: #57c7ff;
  --warm: #ffb257;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 14px/1.45 system-ui, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status {
  margin-left: auto;
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.status.busy { color: var(--warm); }
.status.ready { color: var(--accent); }

.start {
  border: 1px solid var(--line);
  background: #1b2530;
  color: var(--text);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

.start:hover { border-color: var(--accent); }

main {
  flex: 1;
  display: flex;
  min-height: 0;
}

aside {
  width: 330px;
  min-width: 260px;
  padding: 14px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  background: var(--panel);
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field > span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  margin-bottom: 4px;
}

select, input[type=range] {
  width: 100%;
}

select {
  background: #0f151c;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}

.layer {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #101820;
}

.layer .title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 6px;
}

.layer .title b { font-weight: 600; }
.layer .val { color: var(--dim); font-variant-numeric: tabular-nums; }

.layer.opts {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px 8px;
  align-items: center;
  font-size: 11px;
  color: var(--dim);
  margin-top: 6px;
}

.layer.opts input[type=range] { margin: 0; }

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: #2a3846;
  border-radius: 2px;
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

#stage {
  position: relative;
  flex: 1;
  min-width: 0;
}

#viz { width: 100%; height: 100%; display: block; }

.hint {
  position: absolute;
  left: 18px;
  bottom: 14px;
  font-size: 12px;
  color: var(--dim);
}

.fb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}

.stars span {
  cursor: pointer;
  font-size: 14px;
  color: #2f3f4f;
  transition: color 0.12s;
}

.stars span.on { color: var(--warm); }
.stars span:hover { color: #ffd08a; }

.dice, .mini {
  border: 1px solid var(--line);
  background: #16202a;
  color: var(--text);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.4;
}

.dice:hover { border-color: var(--accent); }
.mini.keep:hover { border-color: #57d38c; }
.mini.undo:hover { border-color: #ff7a7a; }
