html, body { margin: 0; height: 100%; overflow: hidden; background: #aac8e6; font-family: system-ui, sans-serif; }
canvas { display: block; }

#loading {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: #1c2430; color: #fff; font-size: 22px; z-index: 10;
}

#hud { position: fixed; left: 20px; bottom: 20px; color: #fff; pointer-events: none; }
#speed {
  font-size: 48px; font-weight: 700; text-shadow: 0 2px 6px rgba(0,0,0,.6);
  font-variant-numeric: tabular-nums;
}
#speed small { font-size: 16px; margin-left: 6px; font-weight: 500; }

#help {
  position: fixed; left: 16px; top: 16px; padding: 10px 14px; border-radius: 8px;
  background: rgba(20,25,35,.7); color: #e8ecf2; font-size: 13px; line-height: 1.6;
}
#help.hidden { display: none; }

#minimap {
  position: fixed; right: 16px; top: 16px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.85); box-shadow: 0 2px 10px rgba(0,0,0,.4);
  background: #e9e5dc;
}

#attrib { position: fixed; right: 8px; bottom: 6px; font-size: 11px; color: #334; background: rgba(255,255,255,.6); padding: 2px 6px; border-radius: 4px; }
#attrib a { color: inherit; }

/* ---------- редактор ---------- */
body.editing #help, body.editing #hud { display: none; }
#editor {
  position: fixed; left: 16px; top: 16px; width: 300px; padding: 12px 14px; border-radius: 10px;
  background: rgba(20,25,35,.88); color: #e8ecf2; font-size: 13px; line-height: 1.45;
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
}
#editor.hidden, #editor .hidden { display: none; }
#editor .ed-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
#editor .ed-title small { font-weight: 400; opacity: .6; margin-left: 6px; font-size: 12px; }
#editor .ed-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#editor button {
  background: #2d3748; color: #e8ecf2; border: 1px solid #4a5568; border-radius: 6px;
  padding: 6px 8px; font: inherit; cursor: pointer; text-align: left;
}
#editor button:hover { background: #3a4659; }
#editor button.on { background: #2b6cb0; border-color: #63b3ed; }
#editor .ed-hint { margin: 10px 0; padding: 8px; background: rgba(255,255,255,.06); border-radius: 6px; color: #cbd5e0; min-height: 3em; }
#editor .ed-props { border-top: 1px solid #4a5568; padding-top: 10px; margin-bottom: 10px; }
#editor .ed-name { margin-bottom: 8px; color: #cbd5e0; }
#editor .ed-name a { color: #90cdf4; }
#editor label { display: flex; justify-content: space-between; align-items: center; margin: 6px 0; }
#editor input { width: 90px; padding: 4px 6px; border-radius: 5px; border: 1px solid #4a5568; background: #1a202c; color: #fff; font: inherit; }
#editor .ed-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
#editor .ed-status { font-size: 12px; opacity: .85; }
#editor .ed-status.ok { color: #9ae6b4; }
#editor .ed-status.err { color: #feb2b2; }
#editor .ed-sub { margin-top: 8px; color: #cbd5e0; }
#editor .ed-arch { display: flex; align-items: center; gap: 4px; margin: 4px 0; font-size: 12px; }
#editor .ed-arch input { width: 46px; padding: 2px 4px; }
#editor .ed-arch button { padding: 2px 6px; }
#editor .ed-help { margin-top: 10px; font-size: 12px; opacity: .6; }
