/* ── Editor panels ─────────────────────────────────────────────────────
   Scoped to body.editor-active so they never interfere with gameplay.   */

/* ── Toolbar (top bar) ─────────────────────────────────────────────── */
.editor-toolbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  z-index: 100;
  pointer-events: auto;
  font-family: 'Segoe UI', sans-serif;
}

.editor-toolbar button {
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.editor-toolbar button:hover {
  background: #30363d;
}
.editor-toolbar button:active {
  background: #3a424b;
}
.editor-toolbar button.primary {
  background: #238636;
  border-color: #2ea043;
  color: #fff;
}
.editor-toolbar button.primary:hover {
  background: #2ea043;
}
.editor-toolbar button.danger {
  color: #f85149;
}

.editor-toolbar .separator {
  width: 1px;
  height: 28px;
  background: #30363d;
  margin: 0 4px;
}

.editor-toolbar .spacer {
  flex: 1;
}

.editor-toolbar .save-indicator {
  font-size: 12px;
  color: #8b949e;
  margin-left: 8px;
}

/* ── Properties panel (left) ──────────────────────────────────────── */
.editor-properties {
  position: fixed;
  top: 48px;
  left: 0;
  width: 240px;
  bottom: 0;
  background: #161b22;
  border-right: 1px solid #30363d;
  z-index: 99;
  pointer-events: auto;
  overflow-y: auto;
  padding: 12px;
  font-family: 'Segoe UI', sans-serif;
  color: #c9d1d9;
}

.editor-properties h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8b949e;
  margin: 16px 0 8px;
}
.editor-properties h3:first-child {
  margin-top: 0;
}

.editor-properties label {
  display: block;
  font-size: 12px;
  color: #8b949e;
  margin-bottom: 4px;
}

.editor-properties input[type="text"],
.editor-properties input[type="number"] {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #c9d1d9;
  padding: 6px 8px;
  font-size: 13px;
  margin-bottom: 8px;
  outline: none;
}
.editor-properties input:focus {
  border-color: #58a6ff;
}

.editor-properties .prop-row {
  display: flex;
  gap: 8px;
}
.editor-properties .prop-row > div {
  flex: 1;
}

.editor-properties .no-selection {
  color: #484f58;
  font-size: 13px;
  font-style: italic;
  margin-top: 12px;
}

/* ── Component palette (right) ────────────────────────────────────── */
.editor-palette {
  position: fixed;
  top: 48px;
  right: 0;
  width: 220px;
  bottom: 0;
  background: #161b22;
  border-left: 1px solid #30363d;
  z-index: 99;
  pointer-events: auto;
  overflow-y: auto;
  padding: 12px;
  font-family: 'Segoe UI', sans-serif;
  color: #c9d1d9;
}

.editor-palette h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8b949e;
  margin: 14px 0 6px;
}
.editor-palette h3:first-child {
  margin-top: 0;
}

.editor-palette .palette-tile {
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 4px;
  font-size: 13px;
  cursor: grab;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.editor-palette .palette-tile:hover {
  background: #30363d;
  border-color: #58a6ff;
}
.editor-palette .palette-tile:active {
  cursor: grabbing;
}

.editor-palette .palette-tile .tile-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: middle;
}
