:root {
  --bg: #16181d;
  --panel: #1d2026;
  --panel-2: #23272f;
  --line: #2e333c;
  --text: #e6e8ec;
  --dim: #8b93a1;
  --accent: #6fb4ff;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* ---------- panel ---------- */

.panel {
  width: 300px;
  flex: 0 0 300px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 11.5px;
}

.controls {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0 14px;
}

.controls::-webkit-scrollbar { width: 9px; }
.controls::-webkit-scrollbar-thumb { background: #333944; border-radius: 9px; }
.controls::-webkit-scrollbar-track { background: transparent; }

.section {
  border-bottom: 1px solid var(--line);
  padding: 12px 18px 14px;
}
.section:last-child { border-bottom: 0; }

.section > h2 {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

.ctl { margin-bottom: 11px; }
.ctl:last-child { margin-bottom: 2px; }
.ctl.hidden { display: none; }

.ctl-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.ctl-label span { color: #c6ccd6; }

.ctl-label b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  font-size: 11.5px;
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  cursor: ew-resize;
  display: block;
}

input[type=range]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: var(--panel-2);
  border: 1px solid #2f343d;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--text);
  border: 0;
  transition: background .12s;
}

input[type=range]:hover::-webkit-slider-thumb { background: var(--accent); }

input[type=range]::-moz-range-track {
  height: 3px; border-radius: 3px; background: var(--panel-2); border: 1px solid #2f343d;
}
input[type=range]::-moz-range-thumb {
  width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--text);
}

select, input[type=number] {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  outline: none;
}
select:focus, input[type=number]:focus { border-color: var(--accent); }

.seed-row { display: flex; gap: 6px; }
.seed-row input { flex: 1; font-variant-numeric: tabular-nums; }

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.toggle input { display: none; }

.toggle .sw {
  width: 32px; height: 18px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  position: relative;
  transition: background .15s;
  flex: 0 0 auto;
}

.toggle .sw::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--dim);
  transition: transform .15s, background .15s;
}

.toggle input:checked + .sw { background: #24486e; border-color: #35618f; }
.toggle input:checked + .sw::after { transform: translateX(14px); background: var(--accent); }

.panel-foot {
  border-top: 1px solid var(--line);
  padding: 12px 18px 14px;
  background: var(--panel);
}

.btn-row { display: flex; gap: 6px; margin-bottom: 6px; }

.btn {
  flex: 1;
  padding: 8px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #2c313a; border-color: #3d444f; }
.btn.primary { background: #24486e; border-color: #35618f; }
.btn.primary:hover { background: #2a5480; }

.btn.rec { background: #6e2430; border-color: #9c3444; color: #ffd9de; }
.btn.rec:hover { background: #80293a; }

.hint { margin: 8px 0 0; color: #5f6773; font-size: 10.5px; text-align: center; }
kbd {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 4px;
  font: inherit;
  font-size: 10px;
}

/* ---------- stage ---------- */

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

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

.stat {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-size: 10.5px;
  letter-spacing: .08em;
  color: rgba(255,255,255,.45);
  background: rgba(0,0,0,.35);
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
  .app { flex-direction: column-reverse; }
  .panel { width: 100%; flex: 0 0 52%; border-right: 0; border-top: 1px solid var(--line); }
  .stage { flex: 1 1 48%; }
}
