* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  background: #0a0a12;
  overflow: hidden;
  font-family: 'Segoe UI', Arial, sans-serif;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#game-root {
  position: relative;
  width: 100vw; height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#game-canvas {
  display: block;
  background: #1c2333;
  touch-action: none;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#editor-toolbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: rgba(18, 18, 28, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 13px;
  z-index: 10;
  border-bottom: 2px solid rgba(0, 229, 255, 0.35);
}

#editor-toolbar.hidden { display: none; }
#editor-toolbar.collapsed { display: none; }

#toolbar-toggle-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 11;
  background: #333;
  color: #fff;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}
#toolbar-toggle-btn:hover { background: #444; }
#toolbar-toggle-btn.hidden { display: none; }

.tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 12px;
  border-right: 1px solid #444;
}

.tool-label { opacity: 0.7; margin-right: 4px; }

#editor-toolbar button {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}
#editor-toolbar button:hover { background: rgba(255, 255, 255, 0.16); }
#editor-toolbar button.primary { background: #00E676; border-color: #33ffa6; color: #062b17; font-weight: bold; }
#editor-toolbar button.active { background: #00E5FF; border-color: #66f2ff; color: #062b3a; font-weight: bold; }

#editor-toolbar input[type=number] {
  background: #222; color: #fff; border: 1px solid #555; border-radius: 3px; padding: 3px;
}

#save-output {
  width: 100%;
  height: 60px;
  background: #111;
  color: #8f8;
  font-family: monospace;
  font-size: 11px;
  border: 1px solid #444;
  margin-top: 4px;
  flex-basis: 100%;
}